Regular Sequences. Eric Rowland. School of Computer Science University of Waterloo, Ontario, Canada. September 5 & 8, 2011

Similar documents
Words generated by cellular automata

Binomial coefficients and k-regular sequences

A MATRIX GENERALIZATION OF A THEOREM OF FINE

Congruences for algebraic sequences

Congruences for combinatorial sequences

NON-REGULARITY OF α + log k n. Eric S. Rowland Mathematics Department, Tulane University, New Orleans, LA

k-automatic sets of rational numbers

arithmetic properties of weighted catalan numbers

A sequence is k-automatic if its n th term is generated by a finite state machine with n in base k as the input.

Continued Fractions New and Old Results

Continued Fractions New and Old Results

Combinatorics on Words:

Open Problems in Automata Theory: An Idiosyncratic View

arxiv: v5 [math.nt] 23 May 2017

The Ubiquitous Thue-Morse Sequence

Automatic sequences, logarithmic density, and fractals. Jason Bell

PUTNAM PROBLEMS SEQUENCES, SERIES AND RECURRENCES. Notes

Some properties of a Rudin Shapiro-like sequence

arxiv: v1 [math.nt] 8 Jan 2014

Morphisms and Morphic Words

ON PATTERNS OCCURRING IN BINARY ALGEBRAIC NUMBERS

GEOMETRY OF BINOMIAL COEFFICIENTS. STEPHEN WOLFRAM The Institute jor Advanced Study, Princeton NJ 08540

Grade 11/12 Math Circles Fall Nov. 12 Recurrences, Part 3

Tewodros Amdeberhan, Dante Manna and Victor H. Moll Department of Mathematics, Tulane University New Orleans, LA 70118

The Logical Approach to Automatic Sequences

Automatic Sequences and Transcendence of Real Numbers

Hankel Matrices for the Period-Doubling Sequence

Numbers and their divisors

Arithmetic properties of coefficients of power series expansion of. (with an appendix by Andrzej Schinzel)

Sierpinski's Triangle and the Prouhet-Thue-Morse Word DAVID CALLAN. Department of Statistics University Ave. November 18, 2006.

Mix-Automatic Sequences

On the N th linear complexity of p-automatic sequences over F p

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Fibonacci numbers. Chapter The Fibonacci sequence. The Fibonacci numbers F n are defined recursively by

From p-adic numbers to p-adic words

2014 MSRI-UP Research Reports

On Arithmetic Properties of Bell Numbers, Delannoy Numbers and Schröder Numbers

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

Bootstrap random walks

arxiv: v1 [math.co] 21 Sep 2015

A relative of the Thue-Morse Sequence

TOPOLOGICAL COMPLEXITY OF 2-TORSION LENS SPACES AND ku-(co)homology

WILLIAM LOWELL PUTNAM MATHEMATICAL COMPETITION. (3k(k + 1) + 1), for n 1.

Introduction to Techniques for Counting

RECOGNIZABLE SETS OF INTEGERS

Square-free words with square-free self-shuffles

Lucas Congruences. A(n) = Pure Mathematics Seminar University of South Alabama. Armin Straub Oct 16, 2015 University of South Alabama.

NORTHWESTERN UNIVERSITY Thrusday, Oct 6th, 2011 ANSWERS FALL 2011 NU PUTNAM SELECTION TEST

On The Discriminator of Lucas Sequences

Induction and Recursion

A REMARK ON THE BOROS-MOLL SEQUENCE

The Separating Words Problem

Induction and recursion. Chapter 5

Fermat s Little Theorem. Fermat s little theorem is a statement about primes that nearly characterizes them.

Conference on Diophantine Analysis and Related Fields 2006 in honor of Professor Iekata Shiokawa Keio University Yokohama March 8, 2006

Zero-one laws for multigraphs

Minimum Critical Exponents for Palindromes

Concerning Kurosaki s Squarefree Word

Fast Computation of the Nth Term of an Algebraic Series over a Finite Prime Field

The Formal Inverse of the Period-Doubling Sequence

q-binomial coefficient congruences

k 2r n k n n k) k 2r+1 k 2r (1.1)

CSC2100B Data Structures Analysis

(ABSTRACT) NUMERATION SYSTEMS

On the Primitivity of some Trinomials over Finite Fields

Émilie Charlier 1 Department of Mathematics, University of Liège, Liège, Belgium Narad Rampersad.

Binary words containing infinitely many overlaps

An extension of the Pascal triangle and the Sierpiński gasket to finite words. Joint work with Julien Leroy and Michel Rigo (ULiège)

INITIAL POWERS OF STURMIAN SEQUENCES

A Short Proof of the Transcendence of Thue-Morse Continued Fractions

Algebra for error control codes

THE p-adic VALUATION OF LUCAS SEQUENCES

ON THE EQUATION X n 1 = BZ n. 1. Introduction

Some results on the existence of t-all-or-nothing transforms over arbitrary alphabets

Automata and Number Theory

Je Lagarias, University of Michigan. Workshop on Discovery and Experimentation in Number Theory Fields Institute, Toronto (September 25, 2009)

Sums of Digits, Overlaps, and Palindromes

Remarks on Separating Words

Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed page of such transmission.

A problem around Mahler functions

Super congruences involving binomial coefficients and new series for famous constants

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

Partition of Integers into Distinct Summands with Upper Bounds. Partition of Integers into Even Summands. An Example

2-ADIC PARTIAL STIRLING FUNCTIONS AND THEIR ZEROS. 1. Introduction

A New Algorithm to Compute Terms in Special Types of Characteristic Sequences

On prime factors of subset sums

Constant Space and Non-Constant Time in Distributed Computing

Mathematics for Cryptography

Games derived from a generalized Thue-Morse word

Application of Logic to Generating Functions. Holonomic (P-recursive) Sequences

MCS 256 Discrete Calculus and Probability Exam 5: Final Examination 22 May 2007

Critical density, automorphisms, and Harm Derksen. Jason Bell

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

ZEROES OF INTEGER LINEAR RECURRENCES. 1. Introduction. 4 ( )( 2 1) n

arxiv:math/ v1 [math.co] 10 Oct 2003

QUOTIENTS OF FIBONACCI NUMBERS

Math Circle: Recursion and Induction

MATH 1111 Section P.1 Bland. Algebraic Expressions - An algebraic expression is a combination of variables and numbers using operations.

Transcription:

Regular Sequences Eric Rowland School of Computer Science University of Waterloo, Ontario, Canada September 5 & 8, 2011 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 1 / 38

Outline 1 Motivation and basic properties 2 Sampler platter 3 Relationships to other classes of sequences Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 2 / 38

Everyone s favorite sequence Thue Morse sequence: { 0 if the binary representation of n has an even number of 1s a(n) = 1 if the binary representation of n has an odd number of 1s. For n 0, the Thue Morse sequence is 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1. Rediscovered several times as an infinite cube-free word on {0, 1}. a(2n + 0) = a(n) a(2n + 1) = 1 a(n) Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 3 / 38

My favorite sequence Let ν k (n) be the exponent of the largest power of k dividing n. For n 0, the ruler sequence ν 2 (n + 1) is 0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 4 0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 5. 6 5 4 3 2 1 ν 2 (2n + 0) = 1 + ν 2 (n) ν 2 (2n + 1) = 0 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 4 / 38

Counting nonzero binomial coefficients modulo 8 Let a(n) = {0 m n : ( n m) 0 mod 8}. 60 50 40 30 20 10 1 2 3 4 5 6 7 8 5 10 9 12 11 14 14 16 5 10 13 20 13 18 20 24 a(2n + 1) = 2a(n) a(4n + 0) = a(2n) a(8n + 2) = 2a(n) + 2a(2n) + a(4n + 2) a(8n + 6) = 2a(4n + 2) Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 5 / 38

Definition Convention: We index sequences starting at n = 0. Definition (Allouche & Shallit 1992) Let k 2 be an integer. An integer sequence a(n) is k-regular if the Z-module generated by the set of subsequences is finitely generated. {a(k e n + i) : e 0, 0 i k e 1} We can take the generators to be elements of this set. Every a(k e n + i) is a linear combination of the generators. In particular, a(k e (kn + j) + i) is a linear combination of the generators, which gives a finite set of recurrences that determine a(n). Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 6 / 38

Homogenization For the Thue Morse sequence: a(2n + 0) = a(n) a(2n + 1) = 1 a(n) But we can homogenize: a(2n) = a(n) a(2n + 1) = a(2n + 1) a(4n + 1) = a(2n + 1) a(4n + 3) = a(n) So a(n) and a(2n + 1) generate the Z-module, and we have written a(2n + 0), a(2n + 1), a(2(2n + 0) + 1), a(2(2n + 1) + 1) as linear combinations of the generators. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 7 / 38

Basic properties Regular sequences inherit self-similarity from base-k representations of integers. The nth term a(n) can be computed quickly using O(log n) additions and multiplications. The set of k-regular sequences is closed under... termwise addition termwise multiplication multiplication as power series shifting (b(n) = a(n + 1)) modifying finitely many terms Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 8 / 38

Outline 1 Motivation and basic properties 2 Sampler platter 3 Relationships to other classes of sequences Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 9 / 38

More examples Regular sequences are everywhere... The length a(n) of the base-k representation of n + 1 is a k-regular sequence: a(kn + i) = 1 + a(n). The number of comparisons a(n) required to sort a list of length n using merge sort is 0 0 1 3 5 8 11 14 17 21 25 29 33 37 41 45. This sequence satisfies and is 2-regular. a(n) = a( n 2 ) + a( n 2 ) + n 1 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 10 / 38

Dragon curve The coordinates (x(n), y(n)) of paperfolding curves are 2-regular. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 11 / 38

p-adic valuations of integer sequences ν k (n + 1) is k-regular: a(kn + k 1) = 1 + a(n) a(kn + i) = 0 if i k 1. Bell 2007: If f (x) is a polynomial, ν p (f (n)) is p-regular if and only if f (x) factors as (product of linear polynomials over Q) (polynomial with no roots in Z p ). ν p (n!) is p-regular. Closure properties imply that is p-regular. ν p (C n ) = ν p ((2n)!) 2ν p (n!) ν p (n + 1) Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 12 / 38

p-adic valuations of integer sequences Medina Rowland 2009: ν p (F n ) is p-regular. The Motzkin numbers M n satisfy (n + 2)M n (2n + 1)M n 1 3(n 1)M n 2 = 0. Conjecture If p = 2 or p = 5, then ν p (M n ) is p-regular. Open question Given a polynomial-recursive sequence f (n), for which primes is ν p (f (n)) p-regular? Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 13 / 38

Number theoretic combinatorics The sequence of integers expressible as a sum of distinct powers of 3 is 2-regular: 0 1 3 4 9 10 12 13 27 28 30 31 36 37 39 40 a(2n) = 3a(n) a(4n + 1) = 6a(n) + a(2n + 1) a(4n + 3) = 3a(n) + 4a(2n + 1) The sequence of integers whose binary representations contain an even number of 1s is 2-regular: 0 3 5 6 9 10 12 15 17 18 20 23 24 27 29 30 Let n w be the number of occurrences of w in the base-k representation of n. For every word w, n w is k-regular. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 14 / 38

Nonzero binomial coefficients Let a p α(n) = {0 m n : ( n m) 0 mod p α }. Glaisher 1899: Fine 1947: a 2 (n) = 2 n 1. a p (n) = where n = n l n 1 n 0 in base p. l (n i + 1), i=0 For example, a 5 (n) = 2 n 13 n 24 n 35 n 4. It follows that a p (n) is p-regular. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 15 / 38

Nonzero binomial coefficients Rowland 2011: Algorithm for obtaining a symbolic expression in n for a p α(n). It follows that a p α(n) is p-regular for each α 0. For example: ( l ) ( l 1 a p 2(n) = (n i + 1) 1 + i=0 i=0 p (n i + 1) n i + 1 n i+1 n i+1 + 1 Expressions for p = 2 and p = 3: ( a 4 (n) = 2 n 1 1 + 1 ) 2 n 10 ( a 9 (n) = 2 n 1 3 n 2 1 + n 10 + 1 4 n 11 + 4 3 n 20 + 1 ) 3 n 21 ). Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 16 / 38

Nonzero binomial coefficients Higher powers of 2: a 8 (n) = 2 n 1 ( 1 + 1 8 n 2 10 + 3 8 n 10 + n 100 + 1 ) 4 n 110 a 16 (n) 2 n 1 = 1 + 5 12 n 10 + 1 2 n 100 + 1 8 n 110 + 2 n 1000 + 1 2 n 1010 + 1 2 n 1100 + 1 8 n 1110 + 1 16 n 2 10 + 1 2 n 10 n 100 + 1 8 n 10 n 110 + 1 48 n 3 10 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 17 / 38

Powers of polynomials If f (x) F p α[x], how many nonzero terms are there in f (x) n? Such a sequence has an interpretation as counting cells in a cellular automaton. Here is (x d + x + 1) n over F 2 for d = 2, 3, 4: Amdeberhan Stanley 2008: Let f (x 1,..., x m ) F p α[x 1,..., x m ]. The number a(n) of nonzero terms in the expanded form of f (x 1,..., x m ) n is p-regular. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 18 / 38

Another kind of self-similarity Here is a cellular automaton that grows like n: The length of row n is 2-regular. The number of black cells on row n is 2-regular. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 19 / 38

Lexicographically extremal words avoiding a pattern What is the lexicographically least square-free word on Z 0? 0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 4 0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 5 The nth term is ν 2 (n + 1). The lexicographically least k-power-free word is given by ν k (n + 1). k = 3: 0 0 1 0 0 1 0 0 2 0 0 1 0 0 1 0 0 2 0 0 1 0 0 1 0 0 3 0 0 1 0 0 k = 4: 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 2 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 20 / 38

Lexicographically extremal words avoiding a pattern If w = w 1 w 2 w l is a length-l word and r Q 0 such that r l Z, let w r = w r w 1 w 2 w l (r r ) be the word consisting of repeated copies of w truncated at rl letters. For example... (deci) 3/2 = decide (raisonne) 3/2 = raisonnerais (schuli) 3/2 = schulisch Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 21 / 38

Lexicographically extremal words avoiding a pattern What is the lexicographically least word on Z 0 avoiding 3/2-powers? 0 0 1 1 0 2 1 0 0 1 1 2 0 0 1 1 0 3 1 0 0 1 1 3 0 0 1 1 0 2 1 0 0 1 1 4 6 5 4 3 2 1 6 Rowland Shallit 2011: This sequence is 6-regular. Open question When are such sequences k-regular, and for what value of k? Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 22 / 38

Outline 1 Motivation and basic properties 2 Sampler platter 3 Relationships to other classes of sequences Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 23 / 38

Constant-recursive sequences The companion matrix of a constant-recursive sequence a(n) satisfies a(n) a(n + 1) a(n + 1) M. = a(n + 2).. a(n + r 1) a(n + r) For example, So [ ] [ ] [ ] 0 1 Fn F = n+1 1 1 F n+1 F n + F n+1 = F n = [ 1 0 ] [ ] n [ ] 0 1 0. 1 1 1 [ Fn+1 F n+2 ]. In general a(n) = λm n κ. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 24 / 38

Matrix formulation Take r generators a 1 (n),..., a r (n) of a k-regular sequence. Each a j (kn + i) is a linear combination of the r generators. Encode the coefficients in r r matrices M 0, M 1,..., M k 1. Then if n = n l n 1 n 0 in base k, then a(n) = λm nl M n1 M n0 κ. Again consider the Thue Morse sequence; generators a(n), a(2n + 1). a(2n) = 1 a(n) + 0 a(2n + 1) a(2n + 1) = 0 a(n) + 1 a(2n + 1) a(2(2n + 0) + 1) = 0 a(n) + 1 a(2n + 1) a(2(2n + 1) + 1) = 1 a(n) + 0 a(2n + 1) Then M 0 = [ ] 1 0, M 0 1 1 = [ ] 0 1. 1 0 Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 25 / 38

Matrix formulation Corollaries... In a sense, constant-recursive sequences are 1-regular. A k-regular sequence has constant-recursive subsequences. For example, a(k n ) = λm 1 M n 0 κ. If a(n) is k-regular, then a(n) = O(n d ) for some d. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 26 / 38

Automatic sequences A sequence a(n) is k-automatic if there is a finite automaton whose output is a(n) when fed the base-k digits of n. The Thue Morse sequence is 2-automatic: 0 1 0 1 1 0 Allouche Shallit 1992: A k-regular sequence is finite-valued if and only if it is k-automatic. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 27 / 38

Hierarchy of integer sequences Fix k 2. k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 28 / 38

Automatic sequences Automatic sequences have been very well studied. Charlier Rampersad Shallit 2011: Many operations on k-automatic sequences produce k-regular sequences. Büchi 1960: If a(n) is eventually periodic, then a(n) is k-automatic for every k 2. Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 29 / 38

Hierarchy of integer sequences We add eventually periodic sequences: ev. periodic k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 30 / 38

Polynomials The sequence a(n) = n is k-regular for every k 2: a(kn + i) = k(1 i)a(n) + i a(kn + 1) a(k 2 n + i) = k(k i)a(n) + i a(kn + 1) It follows that every polynomial sequence is k-regular (as every polynomial sequence is constant-recursive). Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 31 / 38

Hierarchy of integer sequences Every (eventually) polynomial sequence is k-regular. ev. periodic ev. polynomial k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 32 / 38

Hierarchy of integer sequences If a(n) is eventually polynomial and k-automatic, then a(n) is eventually constant. ev. constant ev. periodic ev. polynomial k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 33 / 38

Hierarchy of integer sequences Every polynomial sequence is constant-recursive. (And not every k-automatic sequence is constant-recursive.) ev. constant-recursive ev. constant ev. periodic ev. polynomial k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 34 / 38

Hierarchy of integer sequences Allouche Shallit 1992: If a(n) is constant-recursive and k-regular, then a(n) is eventually quasi-polynomial. ev. quasi-polynomial ev. constant-recursive ev. constant ev. periodic ev. polynomial k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 35 / 38

Hierarchy of integer sequences And to entice us... eventually polynomial-recursive ev. constant-recursive ev. quasi-polynomial ev. constant ev. periodic ev. polynomial k-automatic k-regular Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 36 / 38

Sequences that are not regular By Bell s theorem, ν 2 (n 2 + 7) is not 2-regular. 0 3 0 4 0 5 0 3 0 3 0 7 0 4 0 3 0 3 0 4 0 6 0 3 0 3 0 5 0 4 0 3 Bell 2005, Moshe 2008, Rowland 2010: α + log k (n + 1) is k-regular if and only if k α is rational. For example, 1 2 + log 2 (n + 1) is not 2-regular. 0 1 2 2 2 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 Is there a natural (larger) class that these sequences belong to? Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 37 / 38

Generalizations Two generalizations of k-regular sequences: Allow polynomial coefficients in n (analogous to polynomial-recursive sequences). Becker 1994, Dumas 1993, Randé 1992: If a(n) is k-regular, then f (x) = n=0 a(n)x n satisfies a Mahler functional equation m p i (x)f (x k i ) = 0. i=0 How natural are these generalizations? It remains to be seen... Eric Rowland (University of Waterloo) Regular Sequences September 5 & 8, 2011 38 / 38