When premises are rented for an indefinite time, with monthly or other periodic rent reserved, such tenancy shall be construed to be a tenancy from month to month, or from period to period on which rent is payable, and shall be terminated by written notice of thirty days or more, preceding the end of any of said months or periods, given by either party to the other.