ACTA ARITHMETICA LX.1 (1991)

Generalized Rudin–Shapiro

by

Jean-Paul Allouche (Talence) and Pierre Liardet* (Marseille)

1. Introduction

1.1. The Rudin–Shapiro was introduced independently by these two authors ([21] and [24]) and can be defined by

u(n) εn = (−1) , where u(n) counts the number of 11’s in the binary expansion of the integer n (see [5]). This sequence has the following property:

X 2iπnθ 1/2 (1) ∀ N ≥ 0, sup εne ≤ CN , θ∈R n

X 2iπxu(n) 0 α(x) (2) sup f(n)e ≤ C N , f∈M2 n

* Research partially supported by the D.R.E.T. under contract 901636/A000/DRET/ DS/SR 2 J.-P. Allouche and P. Liardet exponent α(x) is explicitly given and satisfies ∀ x 1/2 ≤ α(x) ≤ 1 , ∀ x 6∈ Z α(x) < 1 , ∀ x ∈ Z + 1/2 α(x) = 1/2 . Moreover, the constant C0 does not depend on x. Of related interest see the papers of Rider [20], Brillhart and Carlitz [5], Brillhart and Morton [7], Brillhart, Erd˝osand Morton [6], Mend`es France and Tenenbaum [17], Queff´elec[18], and Boyd, Cook and Morton [4]. 1.2. In this paper we are going to extend these results to other se- quences. One particularly appealing example of generalization consists in counting the number of words of length d + 2 which begin and end in 1 in the binary expansion of the integer n (the case d = 0 gives precisely the Rudin–Shapiro sequence). Extending this idea we will introduce Hadamard matrices: such a matrix (of order q) gives sequences which can be generated by finite automata and which satisfy (2) where M2 is replaced by the set Mq of q-multiplicative sequences of modulus 1 (for the theory of Hadamard matrices, see for example [25]). Section 2 is devoted to a general notion of sequences (called chained sequences) in a compact and metrizable . These sequences satisfy inequalities analogous to (2) where the exponential function is replaced by an irreducible representation of the group. When the group is abelian, the optimal case giving bounds as in (1) implies that the group is necessarily finite. Let us notice (from Lemma 4 below) that bounds as in (1) and (2) depend only on the orbit of the sequence under the shift: for instance every sequence in the closed orbit of the Rudin–Shapiro sequence under the shift on {−1, +1}N satisfies (1) where C is replaced by another suitable constant. In Section 3 we define generalized Rudin–Shapiro sequences including previous extensions introduced by M. Queff´elec ([19]). These sequences still have the Lebesgue measure as spectral measure.

2. Chained sequences 2.1. Notations and definitions. In what follows q is an integer greater than or equal to 2, A is the alphabet {0, 1, 2, . . . , q − 1} with the natural order. The of finite words on A is denoted by A∗ and is ordered with the lexicographical order, denoted by ≤. The number of letters in a word w is called the length of w and denoted by |w|. The empty word Λ is of length 0. Let Ar be defined by Ar := {w ∈ A∗; |w| = r} . Let d be a positive integer and D := Ad+1. The set D can be considered as Rudin–Shapiro sequences 3 an alphabet ordered by the lexicographical order. There exists a canonical one-to-one order-preserving map c from D∗ into A∗ which identifies D and Ad+1.

Expanding an integer in base q allows us to define the maps ek (“kth digit”) from N to A by X k n = ek(n)q . k∈N We denote by ne the word et(n)(n) . . . e0(n), with t(0) = 0, and for n 6= 0, t(n) = [(log n)/(log q)] ([x] is the integral part of x). Moreover, to each word ∗ w = wr−1 . . . w0 in A (r ≥ 1) we associate the integer r−1 w˙ = q wr−1 + ... + qw1 + w0 , and we define Λ˙ = 0. For every sequence ϕ with values in a set E, we defineϕ ˙ : A∗ → E by ϕ˙(w) = ϕ(w ˙ ) , and for every map f from A∗ to E we define the sequence fe with values in E by

fe(n) = f(ne) . Definition 2.1. Let G be a multiplicative group. A map f from A∗ to G is called a chained map (over A) if for all letters a, b ∈ A and every word w in A∗ (i) f(0w) = f(w), (ii) f(abw) = f(ab)f(b)−1f(bw). (The rˆole of property (i) is to select chained maps f which derive from a sequence ϕ by the relationϕ ˙ = f. If this property is explicitly required we shall speak of regular chained map. Otherwise we shall omit this extra condition.)

If G is equal to C\{0} (resp. R), f will be called a multiplicative chained map (resp. an additive chained map). Note that iterating (ii) gives for all ∗ letters a1, . . . , as in A and every word w in A −1 −1 (3) f(a1 . . . asw) = (f(a1a2)f(a2) ) ... (f(as−1as)f(as) )f(asw) . An easy computation yields (4) f(αβγ) = f(αβ)f(β)−1f(βγ) for all nonempty words α, β, γ in A∗. 4 J.-P. Allouche and P. Liardet

Finally, if G is abelian one has for every positive integer n

nY −1 o (5) fe(n) = f(0) (f(ek+1(n))) f(ek+1(n)ek(n)) . k∈N By (4) the map f which is chained over A can be lifted through the canonical map c (from D∗ = (Ad+1)∗ to A∗) to a map defined on D∗ and chained over D. A sequence ϕ with values in G is called chained to base q (or chained over A) if the associated mapϕ ˙ (from A∗ to G) is chained. Note thatϕ ˙ is then a regular chained map to base qd+1 for every positive integer d. Example 1. Let ϕ be a complex sequence such that ϕ(0) = 1 and satisfying the functional equation Y ∀ k ∈ N, ϕ(n) = ϕ(ek(n)) . k∈N Then ϕ is said to be strongly q-multiplicative (for q-multiplicativity, see [11]). This sequence is multiplicatively chained to base q. Actually, the mapϕ ˙ is a morphism from the monoid A∗ to the multiplicative group C \{0}. Example 2. Let v be a word in A∗ of length r + 1 (r ≥ 0). We denote by 0r the word consisting of r letters 0 (if r = 0 we define 00 = Λ). Let r Zv(w) be the number of occurrences of the word v in the word 0 w. This number depends only on the integer n =w ˙ if v 6= 0r+1, and we will also denote it by Zv(n). Proposition 2.1. Let v be a word in A∗ such that |v| = r + 1 and r+1 s v 6= 0 . Then the sequence (Zv(n))n is additively chained to base q for every integer s ≥ max{1, r}. 0 ∗ 0 P r o o f. If r = 0 one has, for all words w and w in A , Zv(ww ) = 0 s Zv(w) + Zv(w ), hence the result. Suppose r ≥ 1. Let S = A for s > r and let c be the canonical morphism from S∗ to A∗. We have to prove that the ∗ map Zv ◦ c from S to R is additively chained over S. Let α and β be letters in S and w be a word in S∗. The integer Zv(c(α)c(β)c(w)) is equal to the number of occurrences of v in the words 0sc(α)c(β) and 0sc(β)c(w) minus the number of occurrences of v which: — either occur at the same places in the words c(α)c(β) and 0sc(β), — or occur in 0sc(β) but do not occur in c(α)c(β). This last number is precisely Zv(c(β)), hence

Zv ◦ c(αβw) = Zv ◦ c(αβ) − Zv ◦ c(β) + Zv ◦ c(βw) . In particular, the sequence u discussed in the introduction (which corre- sponds to Z11(·) with q = 2), is additively chained to base 2. Rudin–Shapiro sequences 5

Example 3. The following proposition generalizes the previous case: Proposition 2.2. Let d be a positive integer and let ϕ be a periodic d+2 sequence with values in G such that the period of ϕ is q , and ϕ(0) = 1G (the unity of the group G). Let x ∈ G. Then the sequence (6) f(n) = xϕ([n/qt(n)]) . . . ϕ([n/q])ϕ(n) is chained to base qd+1. ∗ P r o o f. For every word w of length r in A , say w = wr−1 . . . w0, one has by definition (6) ˙ f(w) = xϕ˙(wr−1)ϕ ˙(wr−1wr−2) ... ϕ˙(wr−1 . . . w0) .

Note that the value ofϕ ˙(w) depends only on the word wd+1 . . . w0 (w being replaced by 0d+2w if r ≤ d + 1). To prove that f˙ ◦ c is chained (where c is the canonical map from D∗ = (Ad+1)∗ to A∗) it suffices to check that (ii) (in Definition 1) holds for a and b in Ad+1, which is a straightforward computation. This proposition leads to a particular case of chained sequence:

Definition 2.2. Let d ∈ N. A sequence f with values in G is called a d-sequence in base q if there exists a sequence ϕ : N → G such that for every integer n (a) ϕ(qn) = 1G, (b) ϕ(n + qd+2) = ϕ(n) (i.e. ϕ is qd+2-periodic), and (7) f(n) = f(0)ϕ([n/qt(n)]) . . . ϕ([n/q])ϕ(n) . By Proposition 2.2 a d-sequence in base q is chained to base qd+1. Choose x in G and v in Ad+2, with v 6= 0d+2. The sequence

Zv (n) (8) fv(n) = x is chained to base qd+1 from Proposition 2.1 It is a d-sequence in base q if and only if the last letter of the word v is not 0 (i.e. if v 6∈ A∗0). The map ϕ corresponding to fv by (7) is the characteristic function χv of the arithmetic d+2 progression ve + q N. 2.2. Chained sequences in an abelian group. Suppose that the group G is abelian. The set of chained sequences over A with values in G is a commutative group for the usual multiplication: fg(n) = f(n)g(n) for every integer n . The subset of d-sequences in base q is a subgroup, generated by the d- sequences (8). More precisely, if f is a d-sequence in base q, one easily 6 J.-P. Allouche and P. Liardet obtains Y f(n) = f(0) (ϕ(v))Zv (n), where ϕ(v) = f(v ˙)f(0)−1 . v∈Ad+2 In the general case we have Theorem 2.1. Let G be an abelian group and let F : A∗ → G be a regular chained map over A. Then Y (9) F (·) = F (0) (F (b))Zb(·) . b∈A2,b6=00 P r o o f. Let h : A∗ → G be defined by the right hand side of (9). Using Proposition 2.1 and the commutativity of the group G, one sees that h is chained. By construction h(w) = F (w) for every word w of length at most two. An induction on the length of w and the use of the property (ii) of chained maps then give h = F .

2.3. Transition matrices 2.3.1. In what follows the usual hermitian products in the vector spaces s are denoted by (·|·). The corresponding quadratic norms are denoted C 0 by k · k. Every linear operator A : Cs → Cs will be expressed in the 0 0 canonical bases {I1,...,Is}, {I1,...,Is0 } unless explicitly stated otherwise. The quadratic norm of A is denoted by kAk and defined by kAk := sup kAXk . kXk=1 It is well known that kAk is equal to the square root of the largest modulus of the eigenvalues of AA, where A is the adjoint of A (recall that all eigenvalues of AA are real). If A is an endomorphism of Cq given by a matrix all coefficients of which are of modulus 1, then q1/2 ≤ kAk ≤ q . One has kAk = q1/2 if and only if AA = qI (where I is the identity endomor- phism), and kAk = q if and only if A has rank 1. Let us give a generalization of this result. Let E = (End Cs)q be the space of column vectors X whose q compo- nents iX are endomorphisms of Cs. We consider X as an operator from Cs to (Cs)q given by  1Xx  . s Xx =  .  , x ∈ C , qXx Rudin–Shapiro sequences 7 and we identify (Cs)q with Csq by 1  I1 ξ  .  .   .   1   1  ξ  Is ξ  .  .   .  =  .  .  .   .  q  q  ξ  I1 ξ   .   .  q Is ξ  1ξ   .  2 1 2 q 2 Hence the norm of ξ =  .  is given by kξk = k ξk + ... + k ξk qξ and for X ∈ E, kXk = sup (k 1Xxk2 + ... + k qXxk2)1/2 . kxk=1 In terms of matrices, an endomorphism A in E is canonically represented by a matrix  1 1  A1 ... Aq  ......  q q A1 ... Aq i s i whose elements (the ( Aj)) are endomorphisms of C . Representing the Aj in the canonical basis of Cs, the endomorphism A becomes an endomorphism of (Cs)q (identified with Csq) and its quadratic norm satisfies (10) kAk = sup{kAXk; X ∈ E and kXk = 1} . Indeed, denote by % the supremum on the right hand side of (10) and for ξ in (Cs)q (with components 1ξ, . . . , qξ) choose X with components iX in End Cs such that i XIj = 0 if j 6= 1 , i i XI1 = ξ . An immediate computation shows that kξk = kXk and kAξk = kAXk, hence kAk ≤ %. On the other hand, there exists a vector X0 in E such that kX0k = 1 and kAX0k = %. One has

kAX0k = sup kAX0xk , kxk=1 0 s 0 and there also exists a vector x in C such that k xk = 1 and kAX0k = 0 0 kAX0 xk. Hence, for ξ = X0 x one has % = kAξk ≤ kAk, which finally gives % = kAk. 8 J.-P. Allouche and P. Liardet

The matrix A adjoint to A, seen as an endomorphism of (Cs)q, is given i j by its components (A)j = ( Ai).

Lemma 2.1. Let A be an endomorphism of E = (End Cs)q whose matrix i s elements Aj are isometries of C . Then q1/2 ≤ kAk ≤ q . Moreover, (a) kAk = q1/2 if and only if AA = qI; (b) kAk = q if and only if there exist isometries 1S, . . . , qS, 1U, . . . , sU s i 0 of C and isometries Bj (1 ≤ i, j ≤ q) such that for every i and j  1 0 ... 0  0 iS iA iU =  .  . j  . i 0   . Bj  0 P r o o f. Using the hypothesis on A and the Schwarz inequality, one has for every ξ in (Cs)q q 2 X i 1 i q 2 kAξk = k A1 ξ + ... + Aq ξk i=1 q q X X ≤ (k 1ξk2 + ... + k qξk2) ≤ (qkξk2) = q2kξk2 , i=1 i=1 hence kAk ≤ q. On the other hand, choosing in E the vector Yi with i k −1 1/2 components ( Ak) = ( Ai) , for k = 1, . . . , q, one has kYik = q and q X i i 1/2 kAYik ≥ Aj( Aj) = q = q kYik , i=1 hence, using (10), kAk ≥ q1/2. 1/2 Suppose that kAk = q and consider the vector Yi defined above. We s have kAYik ≤ q, hence kAYik = q. But for every x in C one has q 2 X k i k i 2 2 2 kAYixk = k( A1( A1) + ... + Aq( Aq))xk ≤ q kxk , k=1 where the term corresponding to k = i is q2kxk2, hence all other terms are 0, which gives

k i k i A1 A1 + ... + Aq Aq = 0 if k 6= i . Thus AA = qI = AA. The other implication in (a) is obvious. Rudin–Shapiro sequences 9

Now suppose that kAk = q and let ξ ∈ (Cs)q be such that kξk = 1 and kAξk = q. Then q 2 X i 1 i q 2 q = k A1 ξ + ... + Aq ξk , i=1 but i 1 i q 2 1 2 q 2 k A1 ξ + ... + Aq ξk ≤ q(k ξk + ... + k ξk ) = q , hence necessarily 1/2 i 1 i q 2 1 q q = k A1 ξ + ... + Aq ξk ≤ k ξk + ... + k ξk . But for ix ≥ 0 and ( 1x)2 + ... + ( qx)2 = 1, the maximum of the sum ( 1x)2 + ... + ( qx)2 is obtained when each ix is equal to q−1/2, hence for every i i 1 i q 1/2 k A1 ξ + ... + Aq ξk = q and i 1 i q −1/2 k A1 ξk = ... = k Aq ξk = q . The extremal points of the ball kxk ≤ 1 in Cs are the points of the sphere kxk = 1, hence there exist 1η, . . . , qη in Cs such that i i j η = Aj ξ for j = 1, . . . , q . j i j j i i Let U and S be two isometries such that ξ = UI1 and η = SI1. Then i i j S Aj UI1 = I1 . i i j The scalar product is preserved, hence S Aj U is represented in the canonical basis by an orthogonal matrix of the kind  1 0 ... 0  0 iB =  .  , j  . i 0   . Bj  0 i 0 s−1 where Bj are isometries of C . i 0 Let B be the endomorphism of E defined by the Bj and let S and U be defined by  1S 0   1U 0  . . S =  ..  ,U =  ..  . 0 qS 0 qU S and U are isometries of E and one has SAU = B. 10 J.-P. Allouche and P. Liardet

i 0 Finally, if the components Bj of an endomorphism B of E have the previ- ous form, a straightforward computation gives kBk = q, which proves the implication ⇐ of (b) since kSAUk = kAk. 2.3.2. In this part G is a compact metrizable group. We denote by R(G), or simply R, a complete system of non-trivial irreducible representations π of G. The dimension of π is denoted sπ, its Hilbert space is denoted Hπ and the group of isometries of Hπ is called Uπ. Since G is compact and metrizable, the set R is at most countable and the numbers sπ are finite, sπ thus we will identify Hπ and C . Let F : A∗ → G be a chained map over A (not necessarily regular), and let T be the q × q matrix with entries (row i, column j) i −1 Tj := F (ij)F (j) . Definition 2.3. The matrix T (with entries in G) is called the (forward) transition matrix of F . ∗ Let π ∈ R. Then π◦F : A → Uπ is also a chained map over A, its tran- i i sition matrix is πT , the entries of πT being the isometries (πT )j = π( Tj). i In a general way, to each square matrix T with entries Tj in G, with indices in the set A (instead of {1, . . . , q} as previously), and to each representa- q tion π of G we associate the endomorphism πT of (End Hπ) defined by its i i components (πT )j = π( Tj). Lemma 2.1 justifies the following definition: Definition 2.4. The matrix T with entries in G and indices in A is a contracting matrix (resp. a Hadamard matrix) if for every π in R one has kπT k < q (resp. kπT k = q1/2). If T is a Hadamard matrix, the map F is called a Rudin–Shapiro map; a sequence ϕ is called a generalized Rudin–Shapiro sequence if the associated mapϕ ˙ is a Rudin–Shapiro map. In what follows, we denote by T ∗ the “normalized form” of the matrix T defined by i ∗ 0 i −1 i 0 −1 (T )j = T0( T0) ( Tj)( Tj) . Notice that all the entries in the first row and in the first column of T ∗ are equal to 1G, the unit element of G. Moreover, for every representation π of G one has kπT ∗k = kπT k . Theorem 2.2. Let T be a matrix with entries in G and indices in A. One has (a) T is a contracting matrix if and only if the entries of T ∗ span a subgroup of G everywhere dense in G. (b) If G is a commutative group and if T is a Hadamard matrix, then G is finite. Rudin–Shapiro sequences 11

P r o o f. (a) Suppose that T is not a contracting matrix and let π ∈ R such that kπT k = q. From the proof of Lemma 2.1, with A = πT ∗ and 0 q−1 0 q−1 s s = sπ, there exist vectors ξ, . . . , ξ, η, . . . , η in Hπ = C such that i i ∗ j i ∗ 0 ∗ i 0 0 i η = π( Tj ) ξ. But T0 = Tj = 1G, hence η = ξ and η = ξ for all i and j in A. Thus we can choose all isometries iS, jU equal to M, say, so that if π0 is the representation defined by π0(g) = M −1π(g)M (π0 s is equivalent to π), then the first vector I1 of the canonical basis of C is a 0 i ∗ 0 fixed point of the isometries π ( Tj ). As π is a non-trivial representation, the closed subgroup of G spanned by the entries of T ∗ is different from G. Conversely, suppose that T is contracting and let f be the sequence with values in G defined by f(e qt + ... + e q0) = (et T ∗ ) ... (e1 T ∗ ) t 0 et−1 e0 and

f(0) = ... = f(q − 1) = 1G . The sequence f is chained to base q, and (see Theorem 2.3 below) for every representation π of G X π(f(n)) = O(N (log kπT k)/(log q)) . n

2.4. Summation formulas. Let Us, be the group of unitary endo- s ∗ (m) morphisms of C . For each map f : A → Us, define the vector µ (f) in 12 J.-P. Allouche and P. Liardet

(End Cs)q by  0µ(m)(f)  . (m) . j (m) X µ (f) =  .  and µ (f) := f(jk) . q−1µ(m)(f) k∈Am On the other hand, define the endomorphism τ on the group of sequences ϕ : N → Us by τϕ(n) = ϕ(qn) , and let [ϕ]s be the matrix   ϕ(0)1s 0  ..  [ϕ]s :=  .  0 ϕ(q − 1)1s where 1s is the unit element in Us. ∗ From now on, let F : A → Us be a chained map over A (not necessarily regular), and let T be the forward transition matrix of F . Let ϕ : N → Us be a q-multiplicative sequence. Then j (m+1) X X m+1 X j i (m) µ (ϕ ◦ F ) = ϕ˙(jik)F (jik) = τ ϕ(j) Ti µ (ϕ ◦ F ), i∈A k∈Am i∈A which yields the matrix relation (m+1) m+1 (m) µ (ϕ ◦ F ) = [τ ϕ]sT µ (ϕ ◦ F ) , and for every non-zero integer m (m) m (0) µ (ϕ ◦ F ) = ([τ ϕ]sT ) ... ([τϕ]sT )µ (ϕ ◦ F ) , (0) q where µ (ϕ ◦ F ) is defined in (Us) by its components ϕ(j)F (j). Taking the quadratic norm we have (11) kµ(m)(ϕ ◦ F )k ≤ q1/2kT km (if T is a Hadamard matrix, one has kµ(m)(ϕ ◦ F )k = qm/2kµ(0)(ϕ ◦ F )k). Let N be a non-zero integer and let its base q expansion be t X k N = ek(N)q with et(N) 6= 0 . k=0 t−k+1 Define sk in N and σk in A by t k sk := et(N)q + ... + ek(N)q , for 0 ≤ k ≤ t ,

st+1 := 0 ,

σk := et(N) . . . ek(N), for 0 ≤ k ≤ t ,

σt+1 := Λ. Rudin–Shapiro sequences 13

Assuming now that F is regular, we obtain X X X X ϕ(n)F (ne) = ϕ(n)F (ne) + ϕ(n)F (ne) t n

j

ϕ˙(σkji) = ϕ(sk)ϕ ˙(ji) . Hence X X j (t) ϕ(n)F (ne) = µ (ϕ ◦ F ) n

1≤k≤t j

0≤k≤t j

j

Then, for every q-multiplicative sequence ϕ : N → Us with modulus 1,

X 1/2 α(F ) (14) ϕ(n)F (ne) ≤ c(F )q N . n 1. Let (er)r be a sequence of real numbers in [0,B](B > 0). Then

k k α X rα X r erq ≤ C erq for every k ≥ 0 , r=0 r=0 where (q − 1)α C = C(α, q, B) = B1−α . qα − 1

Indeed, we may suppose α 6= 1 and define two functions H1 and H2 by (1 + x)α − 1 H (x, a) = (x + a)α − xα ,H (x) = 1 2 x

(a is a fixed positive real number). Both H1 and H2 are strictly decreasing on [0, +∞[. Rudin–Shapiro sequences 15

One has k k−1 k−1 X α X α X   Bqk  e qr − e qr = H e qr, e qk ≥ H , e qk r r 1 r k 1 q − 1 k r=0 r=0 r=0  B α q − 1 q − 1  = qkα e H e q − 1 B k 2 B k  B α q − 1 ≥ qkα e H (q − 1) , q − 1 B k 2 hence k k−1 X α X α 1 e qr − e qr ≥ e qkα , r r C k r=0 r=0 where C is the constant defined in the lemma (actually the proof holds for ek 6= 0 but the inequality is still valid in the case ek = 0). Adding these inequalities for k, k − 1, k − 2,..., 1, we get k k X α 1 X e qr ≥ eα + e qrα . r 0 C r r=0 r=1 This implies the lemma by noticing that (q − 1)α e1−α ≤ B1−α ≤ B1−α = C 0 qα − 1 α α α (indeed (q − 1) ≥ q − 1 by the mean value theorem), which gives e0 ≥ (1/C)e0.

R e m a r k. The constant in this lemma is optimal (take er = B for every r and k → +∞). Now, suppose that ϕ is qν -multiplicative (ν > 1), chained, and has ∗ modulus 1. As already noticed, the chained map F : A → Us is also chained over Aν . Denote by T (ν) the corresponding forward transition matrix. Lemma 2.3. kT (ν)k = qν−1kT k . Indeed, if i and j are in Aν , then by definition i −1 (T (ν))j = F (ij)F (j) .

Let i = i1 . . . iν , j = j1 . . . jν , where ik and jk are in A. Using (4) we obtain easily

i i1 iν−1 iν (T (ν))j = Ti2 ... Tiν Tj1 .

i iν Let (T (ν))j = %(i) Tj1 , where %(i) ∈ Us. Multiplying on the left the entries of every row i of T (ν) by %(i), we obtain a matrix T 0(ν) such 16 J.-P. Allouche and P. Liardet that kT 0(ν)k = kT (ν)k. Permute now the columns of T 0(ν) in such a way that the indices j ∈ Aν are in the reverse lexicographical order “ < ”, i.e. 0 0 0 0 j1 . . . jν “ < ” j1 . . . jν ⇔ jν . . . j1 < jν . . . j1 . The new matrix T 00(ν) has the same quadratic norm as T (ν) and has the form  T...T  00 T (ν) =  ......  . T...T

ν Write a vector X in (Cs)q as a column vector with components iX in (Cs)q and notice that ν−1 kXk2 = k 1Xk2 + ... + k q Xk2 . With these notations, 2 2 ν−1 X k kT (ν)k = sup q T X kXk=1 1≤k≤qν−1  X 2 ≤ qν−1kT k2 sup k kXk . kXk=1 1≤k≤qν−1 This last supremum is classically attained when each k kXk is equal to (qν−1)−1/2, which implies kT (ν)k ≤ qν−1kT k . Choosing 1X such that kT 1Xk = kT k · k 1Xk and all the kX equal to 1X, we deduce that the above inequality is actually an equality. From Theorem 2.3 we can deduce the following corollary that we write down for sequences:

Corollary 2.1. Let f : N → Us be a sequence chained in base q, with transition matrix (that of f˙) equal to T . Then for every non-zero integer ν ν and for every q -multiplicative sequence ϕ : N → Us of modulus 1, X ν/2 αν (f) ϕ(n)f(n) ≤ cν (f)q N , n

2.5. Distribution of chained sequences Theorem 2.4. Let G be a compact metrizable group and let F : A∗ → G be a regular chained map over A with forward transition matrix T . Suppose that T is contracting. Then the chained sequence

Fe(n) := F (ne) is well uniformly distributed in G, and has an empty spectrum. P r o o f. By Theorem 2.3, for every representation Π ∈ R and every real number θ, one has in End CsΠ X lim N −1 e2iπnθΠ(F (n)) = 0 . N→∞ e n

Lemma 2.4. For every q-multiplicative ϕ : N → Us, and for all integers k ≥ 0 and N > 0, one has (using notations of Theorem 2.3)

X 3/2−α(ΠT ) 1/2 1/2 α(ΠF ) ϕ(n + k)ΠFe(n + k) ≤ 1 + c(ΠF )2 q (1 + q )N . n 0 and k ≥ 0, define the integer S by eS(k) < eS(k + N) and ej(k) = ej(k + N) for every j ≥ S + 1. Set

X j X j u = ej(k)q , v = ej(k + N)q , j≤S j≤S S X j w = (1 + eS(k))q ,A = ej(k)q . j>S Hence k = A + u, k + N = A + v. Let f = ϕ ◦ ΠFe. Then X X f(k + n) = f(A + m) n

X X S+1 f(k + n) = ϕ(m)ΠFe(eS+1(k)q + m) . n

X S eS+1(k) X S B = ϕ(aq )( (ΠT )a) ϕ(m)ΠFe(aq + m) , S 1+eS (k)≤a

eS+1(k) X S C = ( (ΠT )eS+1(k+N)) ϕ(n)ΠFe(eS(k + N)q + n) . S 0≤n

X S+1 ϕ(m)ΠFe(eS+1(k)q + m) w≤m

1/2X j S ≤ Cqq ej(k + N)kT k + (eS(k + N) − eS(k) − 1)kT k . j

Since eS(k + N) − eS(k) − 1 ≥ 0, the above equality is exactly the base q expansion of v − w. Hence, using Lemma 2.2 with α = α(T ), we obtain

X S+1 1/2 α α ϕ(m)ΠFe(eS+1(k)q + m) ≤ Cqq (v − w) (q − 1)/(q − 1) . w≤m

X i rj = ei(k)q (rS = 0) , j

jν uν = rjν + (ejν (k) + 1)q

jν+1−1 jν +1 jν = rjν+1 + (q − 1)q + ... + (q − 1)q + (ejν (k) + 1)q .

One has u1 = u0 + 1, uσ = w, and for 1 ≤ ν < σ

X S+1 ϕ(m)ΠFe(eS+1(k)q + m)

uν ≤m

X X jν S+1 jν = ϕ(uν ) ϕ(aq + m)ΠFe(eS+1(k)q + uν + aq + m) jν a

0 X jν X jν = C ϕ(aq ) ϕ(m)ΠFe(uν + aq + m) , jν a

X S+1 1/2 X j ϕ(m)ΠFe(eS+1(k)q + m) ≤ 1 + q (q − ej(k) − 1)kT k u≤m

Finally,

X 1/2 α α α f(k + n) ≤ 1 + Cqq [(v − w) + (w − u) ](q − 1)/(q − 1) n

3. Generalized Rudin–Shapiro sequences 3.1. In what follows q = 2, A = {0, 1}, d is a positive integer and D = 2d+1. Definition 3.1. The sequence u : N → N is called a Rudin–Shapiro sequence of order d on ab ∈ A2, ab 6= 00, if X u(n) = Zavb(n) . |v|=d Theorem 3.1. Let u be a Rudin–Shapiro sequence of order d on ab, let v be a chained additive sequence in base 2r, r ≥ d, and let ϕ : N → C be a 2k-multiplicative sequence of modulus 1, with k ≥ d + 1. Then, for every N ≥ 1,

X 2iπ(αu(n)+v(n)) 1/2 1/2 δ(α) e ϕ(n) ≤ (1 + D )D N , n

In the proof of Lemma 3.1, the following lemma will be useful (its proof is left to the reader): Lemma 3.2. Let E be a Hermitian space, let A and B be two endo- morphisms of E, let U be an isometry of E, and η a complex number of Rudin–Shapiro sequences 21 modulus 1. Let C be the endomorphism of E × E determined by the matrix  AB  . UA ηUB   1 1 Then kCk ≤ max(kAk, kBk) · , with equality if kAk = kBk. 1 η r P r o o f o f L e m m a 3.1. Let M and N be in A , r ≤ d, and let AM,N d+1−r be the square submatrix of T with elements TMj,Nk, where j ∈ A and d+1−r 0 0 d−r k ∈ A . Define % = TM0j0,N0k0 , where j and k are in A (if d = r we take j0 = k0 = Λ). Then the submatrix   TM0j0,N0k0 TM0j0,N1k0 TM1j0,N0k0 TM1j0,N1k0 has the form  0  % τ 0 0 η % j k 1 , τj0 η1% τj0 τj0k0 η0% where, using (3), one has (as usual e(x) denotes e2iπx) 0 0 τj0 = e(ve(M1j N) − ve(M0j N)) , 0 0 0 0 τj0k0 = e(ve(j N1k ) − ve(j N0k )) while  0  1 η1 Uη =: η1 η0 is equal to  1 η  if ab = 01 , 1 1  1 1  if ab = 10 , η 1  1 1  if ab = 11 . 1 η Hence   AM0,N0 AM0,N1 AM,N = 0 , η1UAM0,N0 η0η1UAN0,N1 0 d−r where U is the diagonal matrix with diagonal elements rj0 (j ∈ A ). From Lemma 3.2 one gets     1 1 1 1 kT k ≤ max{kA0,0k, kA0,1k} · (as kUηk = ) . 1 η 1 η 22 J.-P. Allouche and P. Liardet

On the other hand,   1 1 kAM,N k ≤ max{kAM0,N0k, kAM0,N1k} · , 1 η hence there exist M and N in Ad+1 such that   d+1 1 1 kT k ≤ kAM,N k . 1 η

But AM,N = TM,N has modulus 1, which gives the bound of Lemma 3.1; equality actually follows from iteration of Lemma 3.2.

3.2. The backward transition matrix. The above results have been partially given in [1] and [16]. The proof in [1] was slightly different. Let us quickly describe it to give a bound for the simplified sum X exp(2iπ(αz(n) + Vc(n))) n≤m2N −1 where m ≥ 1 is a fixed integer, (z(n))n is the sequence (u(n))n in case a = b = 1, c = (cq)q is a sequence of real numbers, and Vc is defined by P P q Vc(n) = eq(n)cq if n = eq(n)2 is the binary expansion of n. Define the 2 d+1 vector R(N, c) in C by its components Ru(N, c), 1 ≤ u ≤ 2 , as follows: P (i) R1(N, c) = n≤m2N −1 exp(2iπ(αz(n) + Vc(n))); (ii) if u 6= 1, let k be defined by 2k + 1 ≤ u ≤ 2k+1 (hence 0 ≤ k ≤ d); then X k+1 Ru(N, c) = exp(2iπ(αz(2 n + A(u − 1)) + Vc(n))) , n≤m2N −1 where A(n) is the number obtained by reversing the binary digits of the Pr j Pr r−j integer n (if n = j=0 aj2 , aj = 0 or 1, ar = 1, then A(n) = j=0 aj2 ∈ 2N + 1). Finally, define the matrix M(c) by M(c) = (mu,v(c)), where (iii) for 1 ≤ u ≤ 2d, ( 1 if v = 2u − 1, mu,v(c) = e(c0) if v = 2u , 0 otherwise; (iv) for 2d + 1 ≤ u ≤ 2d+1, ( 1 if v = 2(u − 2d) − 1, d mu,v(c) = e(c0 + α) if v = 2(u − 2 ) , 0 otherwise. Rudin–Shapiro sequences 23

M can be considered to some extent as the backward transition matrix associated to the sequence z. We then obtain R(N, c) = M(c)R(N − 1, T c) , where T c is the shifted sequence (cq+1)q. Hence R(N, c) = M(c)M(T c) ...M(T N−1c)R(0,T N c) . Evaluating the norms of the matrices M(T kc) we obtain the same bound as P above for the sum n

3.3. Spectral properties. We recall that a complex-valued sequence u : N → C has a correlation γu if for all integers k, the sequence n 7→ u(n + k)u(n) converges in Ces`aromeans. By definition, 1 X γu(k) := lim u(n + k)u(n) N→∞ N n 0 , N N n

1/2 quadratic norm kT k = q . Suppose that (νN )N weakly converges to a measure ν. Then 1 X 2 u(n) exp(2πit) ≤ C N n

P r o o f. The existence of γu is given by the following general lemma: Lemma 3.3. Let G be a group, let F : A∗ → G be a chained map to base q and let f : n 7→ F (ne) be the associated sequence. For every integer k there exists a family of arithmetic progressions Pk(m), m = 0, 1, 2 ..., with s (m) common difference q k , and a G-valued sequence m 7→ gk(m) such that −1 (i) the sequence ∆kf : n 7→ f (n)f(n+k) has the constant value gk(m) on Pk(m); P −sk(m) (ii) m≥0 q = 1. Moreover, if G = U then f has a correlation given by ∞ X −sk(m) γf (k) = gk(m)q . m=0 In fact, it is enough to prove the lemma for k = 1. Let 0 ≤ a < q − 1, b ∈ A, j ≥ 0 and define j+2 Rj(a, b) := {n ∈ N; n ≡ αj ( mod q ) and n 6= αj if b = 0} , P ` j j+1 where αj := ( `

P∞ −sk(m) is complex-valued of modulus 1; then by (ii) the series m=0 gk(m)q converges and its sum is equal to γf (k). Going back to the generalized Rudin–Shapiro sequence u, let F be the chained map over A corresponding to u, let T be the transition matrix of ∗ F and for each letter a let Fa be the map defined on A by Fa(w) := F (aw). We know that Fa is chained over A (but not regular for a 6= 0) with (a) Hadamard transition matrix. Hence the sequence u corresponding to Fa has a correlation, say γ(a). Let γ be the correlation of u. We claim that P (a) γ = (1/q) a∈A γ . In fact, for any integer k > 0 and for L > 0 such that k < qL−1 one has 1 X (15) u(n + k)u(n) qL n

X L−1 L−1 X (a) (a) u(aq + n + k)u(aq + n) − u (n + k)u (n) ≤ k . n

νqL = (1 + WL(t)) dt .

This implies that (νqL )L converges weakly to the Lebesgue measure and finishes the proof. R e m a r k s. 1. Theorem 3.2 can be extended to any G-valued chained sequence with Hadamard transition matrix (with G finite and abelian). Let A be endowed with an abelian group law (where 0 is the neutral element), let 26 J.-P. Allouche and P. Liardet

Ab be its dual group and let a 7→ χa be an isomorphism from A to Ab. Then T := (χa(b))ab∈A2 is a Hadamard matrix and gives rise to many examples of generalized Rudin–Shapiro sequences. 2. Recall that the Kronecker product A ⊗ B of matrices A := (aij)ij∈A2 , B := (akl)kl∈B2 is defined by

A ⊗ B := (aijB)ij . Set A(1) := A, A(n+1) = A ⊗ A(n) for n ≥ 1. The transition matrix cor- responding to the Rudin–Shapiro sequence of order d on 11 (Definition 3.1) is given by (d+1)  1 1  . 1 −1 The proof is left to the reader. Notice this matrix is obtained from the above example with A identified with the group (Z/2Z)d+1. 3. Let A be the cyclic group of order q identified by a 7→ ζa (ζ = exp(2πi/q)) to the corresponding cyclic subgroup of U. Then the example given by M. Queff´elecin [18] is the one obtained as in Remark 1 through a b ab the isomorphism ζ 7→ χa, χa(ζ ) := ζ (a, b = 0, 1, . . . , q − 1). 4. In a forthcoming paper we shall study the flows associated to chained sequences, proving that they are (except for degenerate cases) strictly er- godic and can be obtained as group extensions of a q-adic rotation; we shall also give the spectral study of these flows (in this direction, see also [10, 14, 18, 19]). The authors thank Michel Mend`es France for many helpful discussions, and the referee for suggesting to sharpen Lemma 3.2 and its consequences. The present version of this lemma is inspired by personal communications of G´erald Tenenbaum and of Michel Balazard (see also [2], [17] and J.-P. Allouche, M. Mend`es France and G. Tenenbaum, Entropy: an in- equality, Tokyo J. Math. 11 (1988), 323–328).

References

[1] J.-P. Allouche, Les suites de Rudin–Shapiro g´en´eralis´ees: des suites d´eterministes de “dimension” maximale, in: Colloque “Fractals”, C.I.R.M., Marseille 1986. [2] J.-P. Allouche and M. Mend`es France, On an extremal property of the Rudin– Shapiro sequence, Mathematika 32 (1985), 33–38. [3] —, —, Suite de Rudin–Shapiro et mod`ele d’Ising, Bull. Soc. Math. France 113 (1985), 275–283. [4] D. W. Boyd, J. Cook and P. Morton, On sequences of ±1’s defined by binary patterns, Dissertationes Math. 283 (1989). [5] J. Brillhart and L. Carlitz, Note on the Shapiro polynomials, Proc. Amer. Math. Soc. 25 (1970), 114–118. Rudin–Shapiro sequences 27

[6] J. Brillhart, P. Erd˝os and P. Morton, On sums of Rudin–Shapiro coefficients II , Pacific J. Math. 107 (1978), 39–69. [7] J. Brillhart und P. Morton, Uber¨ Summen von Rudin–Shapiroschen Koeffizien- ten, Illinois J. Math. 22 (1978), 126–148. [8] G. Christol, T. Kamae, M. Mend`es France et G. Rauzy, Suites alg´ebriques, automates et substitutions, Bull. Soc. Math. France 108 (1980), 401–419. [9] A. Cobham, Uniform tag-sequences, Math. Systems Theory 6 (1972), 164–192. [10] J. Coquet and P. Liardet, A metric study involving independent sequences, J. Analyse Math. 49 (1987), 15–53. [11] A. O. Gelfond, Sur les nombres qui ont des propri´et´esadditives et multiplicatives donn´ees, Acta Arith. 13 (1968), 259–265. [12] J.-P. Kahane, H´elices et quasi-h´elices, in: Math. Anal. Applic., Part B, Adv. in Math. Suppl. Stud. 7B, 1981, 417–433. [13] L. Kuipers and H. Niederreiter, Uniform Distributions of Sequences, John Wi- ley & Sons, New York 1974. [14] M. Lema ´nczyk, Toeplitz Z2-extensions, Ann. Inst. H. Poincar´e24 (1) (1988), 1–43. [15] P. Liardet, Propri´et´es harmoniques de la num´eration, d’apr`esJean Coquet, in: Colloque S.M.F.-C.N.R.S. “Jean Coquet”, Publications Math´ematiques d’Orsay 88–02, Orsay 1988, 1–35. [16] —, Automata and generalized Rudin–Shapiro sequences, Arbeitsbericht, Math. In- stitut der Universit¨at Salzburg, 1990. [17] M. Mend`es France et G. Tenenbaum, Dimension des courbes planes, papiers pli´eset suite de Rudin–Shapiro, Bull. Soc. Math. France 109 (1981), 207–215. [18] M. Queff´elec, Une nouvelle propri´et´edes suites de Rudin–Shapiro, Ann. Inst. Fourier (Grenoble) 37 (2) (1987), 115–138. [19] —, Substitution Dynamical Systems—Spectral Analysis, Lecture Notes in Math. 1294, Springer, 1987. [20] D. Rider, Transformations of Fourier coefficients, Pacific J. Math. 19 (1966), 347– 355. [21] W. Rudin, Some theorems on Fourier coefficients, Proc. Amer. Math. Soc. 10 (1959), 855–859. [22] B. Saffari, Une fonction extr´emaleli´ee`ala suite de Rudin–Shapiro, C. R. Acad. Sci. Paris 303 (1986), 97–100. [23] A. Salem and A. Zygmund, Some properties of trigonometric series whose terms have random signs, Acta Math. 91 (1954), 245–301. [24] H. S. Shapiro, Extremal problems for polynomials and power series, Thesis, M.I.T., 1951. [25] A. P. Street, J. S. Wallis and W. D. Wallis, Combinatorics: Room Squares, Sum-free Sets, Hadamard Matrices, Lecture Notes in Math. 292, Springer, 1972.

CNRS URA 226 UNIVERSITE´ DE PROVENCE UNIVERSITE´ BORDEAUX I URA 225, CASE 96 MATHEMATIQUES´ ET INFORMATIQUE 3, PLACE VICTOR-HUGO 351, COURS DE LA LIBERATION´ F-13331 MARSEILLE CEDEX 3, FRANCE F-33405 TALENCE CEDEX, FRANCE

Received on 3.11.1989 and in revised form on 30.11.1990 (1984)