On consecutive values of random completely multiplicative functions

In this article, we study the behavior of consecutive values of random completely multiplicative functions $(X_n)_{n \geq 1}$ whose values are i.i.d. at primes. We prove that for $X_2$ uniform on the unit circle, or uniform on the set of roots of unity of a given order, and for fixed $k \geq 1$, $X_{n+1}, \dots, X_{n+k}$ are independent if $n$ is large enough. Moreover, with the same assumption, we prove the almost sure convergence of the empirical measure $N^{-1} \sum_{n=1}^N \delta_{(X_{n+1}, \dots, X_{n+k})}$ when $N$ goes to infinity, with an estimate of the rate of convergence. At the end of the paper, we also show that for any probability distribution on the unit circle followed by $X_2$, the empirical measure converges almost surely when $k=1$.


Introduction
Many arithmetic functions of interest are multiplicative, i.e. their value at mn is the product of their values at m and n, for all coprime integers m, n ≥ 1. For example, it is the case for the Möbius function, which is defined by µ(n) = 0 if n ≥ 1 is divisible by the square of at least one prime number, µ(n) = 1 if n is the product of an even number of distinct primes, and µ(n) = −1 if n is the product of an odd number of distinct primes. Similarly, Dirichlet characters are multiplicative, as well as the Liouville function, which is equal to (−1) k on integers with k prime factors, counted with multiplicity: these functions are even completely multiplicative, which means that their value at mn is the product of their values at m and n for all integers m, n ≥ 1. The behavior of the Möbius and the Liouville functions is far from being known with complete accuracy, even if partial results have been proven. This difficulty can be encoded by the corresponding Dirichlet series, which involve the Riemann zeta function. For example, the partial sum, up to x, of the Möbius function in known to be negligible with respect to x, and it is conjectured to be negligible with respect to x r for all r > 1/2: the first statement can quite easily be proven to be equivalent to the prime number theorem, whereas the second is equivalent to the Riemann hypothesis.
It has been noticed that the same bound x r for all r > 1/2 is obtained if we take the partial sums of i.i.d., bounded and centered random variables. This suggests the naive idea to compare the Möbius function on square-free integers with i.i.d. random variables on {−1, 1}. However, a major difference between the two situations is that in the random case, we lose the multiplicativity of the function. A less naive randomized version of Möbius functions can be obtained as follows: one takes i.i.d. uniform random variables on {−1, 1} on prime numbers, 0 on prime powers of order larger than or equal to 2, and one completes the definition by multiplicativity.
In [29], Wintner considers a completely multiplicative function with i.i.d. values at primes, uniform on {−1, 1} (which corresponds to a randomized version of the Liouville function rather than the Möbius function), and proves that we have almost surely the same bound x r (r > 1/2) for the partial sums, as for the sums of i.i.d. random variables, or for the partial sums of Möbius function if the Riemann hypothesis is true. The estimate in [29] has been refined by Halász in [9], and then by Lau, Tenenbaum and Wu in [17]. Some lower bounds can also be deduced from moment estimates by Harper [10]. In order to get more general results, it can be useful to consider Date: April 27, 2020. 1 complex-valued random multiplicative functions. For example, it has been proven by Bohr and Jessen [2] that for σ > 1/2, the law of ζ(σ + iT U ), for U uniformly distributed on [0, 1], tends to a limiting random variable when T goes to infinity. This limiting random variable can be written as n≥1 X n n −σ , when (X n ) n≥1 is a random completely multiplicative function such that (X p ) p∈P are i.i.d. uniform on the unit circle, P denoting, as in all the sequel of the present paper, the set of prime numbers. The fact that the series just above converges is a direct consequence (by partial summation) of the analog of the result of Wintner for the partial sums of (X n ) n≥1 : one can prove that almost surely, n≤x X n = o(x r ) for r > 1/2. This discussion shows that it is often much less difficult to prove accurate results for random multiplicative function than for the arithmetic functions which are usually considered. In some informal sense, the arithmetic difficulties are diluted into the randomization, which is much simpler to deal with.
In the present paper, we study another example of results which are stronger and less difficult to prove in the random setting than in the deterministic one. The example we detail in this article is motivated by the following question, initially posed in the deterministic setting: for k ≥ 1, what can we say about the distribution of the k-tuples (µ(n + 1), . . . , µ(n + k)), or (λ(n + 1), . . . , λ(n + k)), where µ and λ are the Möbius and the Liouville functions, n varies from 1 to N , N tends to infinity? This question is only very partially solved. One knows (it is essentially a consequence of the prime number theorem), that for k = 1, the proportion of integers such that λ is equal to 1 or −1 tends to 1/2. For the Möbius function, the limiting proportions are 3/π 2 for 1 or −1 and 1 − (6/π 2 ) for 0. It has been proven by Hildebrand [15] that for k = 3, the eight possible values of (λ(n + 1), λ(n + 2), λ(n + 3)) appears infinitely often. This result has been improved by Matomäki, Radziwi l l and Tao [19], who prove that these eight values appear with a positive lower density: in other words, for all (ǫ 1 , ǫ 2 , ǫ 3 The similar result is proven for the nine possible values of (µ(n + 1), µ(n + 2)). A conjecture by Chowla [3] states that for all k ≥ 1, each possible pattern of (λ(n + 1), . . . , λ(n + k)) appears with asymptotic density 2 −k . This conjecture is still open, however, partial results have been recently proven, in particular in papers by Tao and Teräväinen ([24], [25], [26]).
In the present paper, we prove results similar to this conjecture for random completely multiplicative functions (X n ) n≥1 . The random functions we will consider take i.i.d. values on the unit circle on prime numbers. Their distribution is then entirely determined by the distribution of X 2 . The two particular cases we will study in the largest part of the paper are the following: X 2 is uniform on the unit circle U, and X 2 is uniform on the set U q of q-th roots of unity, for q ≥ 2. In this case, we will show the following results: for all k ≥ 1, and for all n ≥ 1 large enough depending on k, the variables X n+1 , . . . , X n+k are independent, and exactly i.i.d. uniform on the unit circle if X 2 is uniform. Moreover, the empirical distribution tends almost surely to the uniform distribution on U k if X 2 is uniform on U, and to the uniform distribution on U k q if X 2 is uniform on U q . In particular, the analog of Chowla's conjecture holds almost surely in the case where X 2 is uniform on {−1, 1}. We have also an estimate on the speed of convergence of the empirical measure: in the case of the uniform distribution on U q , each of the q k possible patterns for (X n+1 , . . . , X n+k ) almost surely occurs with a proportion q −k + O(N −t ) for n running between 1 and N , for all t < 1/2. We have a similar result in the uniform case, if the test functions we consider are sufficiently smooth. It would be interesting to have similar results when the distribution of X 2 on the unit circle is not specified. For k ≥ 2, we are unfortunately not able to show similar results, but we nevertheless can prove that the empirical distribution of X n almost surely converges to a limiting distribution for any distribution of X 2 on the unit circle. We specify this distribution, which is always uniform on U or uniform on U q for some q ≥ 1, and in the latter case, we give an estimate of the rate of convergence. This rate corresponds to a negative power of log N , which is much slower than what we obtain when X 2 is uniform on U q .
The techniques we use in our proofs are elementary in general, mixing classical tools in probability theory and number theory. However, a part of our arguments need to use deep results on diophantine equations, in order to bound the number and the size of their solutions.
The sequel of the paper is organized as follows. In Sections 2 and 3, we study the law of (X n+1 , . . . , X n+k ) for n large depending on k, first in the case where X 2 is uniform on U, then in the case where X 2 is uniform on U q . In Section 4, we study the empirical measure of (X n+1 , . . . , X n+k ) in the case of X 2 uniform on U. In the proof of the convergence of this empirical measure, we need to estimate the second moment of sums of the form N n=N ′ +1 k j=1 X m j n+j . The problem of estimating moments of order different from two for such sums is discussed in Section 5. The proof of convergence of empirical measure in the case of uniform variables on U q is given in Section 6. Finally, we consider the case of a general distribution for X 2 in Section 7.

Independence in the uniform case
In this section, we suppose that (X p ) p∈P are i.i.d. uniform random variables on the unit circle. By convenience, we will extend our multiplicative function to positive rational numbers by setting X p/q := X p /X q : the result is independent of the choice of p and q, and we have X r X s = X rs for all rationals r, s > 0. Moreover, X r is uniform on the unit circle for all positive rational r = 1. In this section, we will show that for fixed k ≥ 1, (X n+1 , . . . , X n+k ) are independent if n is sufficiently large. The following result gives a criterion for such independence: Lemma 2.1. For all n, k ≥ 1, the variables (X n+1 , . . . , X n+k ) are independent if and only if log(n + 1), . . . , log(n + k) are linearly independent on Q.
We then get the following result: Proposition 2.2. The variables (X n+1 , . . . , X n+k ) are i.i.d. as soon as n ≥ (100k) k+1 . In particular, for k fixed, this property is true for all but finitely many n.
Remark 2.3. The same result is proven in [27], Theorem 3. (i), with an asymptotically better bound, namely n ≥ e ck log log(k+2)/ log(k+1) where c > 0 is a constant. However, their proof uses a deep result by Shorey [23] on linear forms in the logarithms of algebraic numbers, involving technical tools by Gelfond and Baker, whereas our proof is elementary. Moreover, the constant c involved in [27] is not given, even if it is explicitly computable.
Proof. Let us assume that we have a linear dependence (1) between log(n + 1), . . . , log(n + k): necessarily k ≥ 2. Moreover, the integers n + j for which m j = 0 cannot be divisible by a prime larger than k: otherwise this factor remains in the product k ℓ=1 (n + ℓ) m j since none of the n + ℓ for ℓ = j can be divisible by p, and then the product cannot be equal to 1. We can rewrite the dependence as follows: for a subset A of {1, . . . , k}\{j} and for R := (r ℓ ) ℓ∈A ∈ Q A . Let us assume that the cardinality |A| is as small as possible. Taking the decomposition in prime factors, we get for all p ∈ P, where v p denotes the exponent of p in the prime factorization. If M := (v p (n + ℓ)) p∈P,ℓ∈A , V := (v p (n + j)) p∈P , then we can write these equalities in a matricial way V = M R. The minimality of |A| ensures that the matrix M has rank |A|. Moreover, since all the prime factors of (n + ℓ) ℓ∈A are smaller than k, all the rows of M indexed by prime numbers larger than k are identically zero, and then the rank |A| of M is at most π(k), the number of primes smaller than or equal to k. Moreover, we can extract a subset Q of P of cardinality |A| such that the restriction M (Q) of M to the rows with indices in Q is invertible. We have with obvious notation: V (Q) = M (Q) R, and then by Cramer's rule, the entries of R can be written as the quotients of determinants of matrices obtained from M (Q) by replacing one column by V (Q) , by the determinant of M (Q) . All the entries involved in these matrices are p-adic valuations of integers smaller than or equal to n + k, so they are at most log(n + k)/ log 2. By Hadamard inequality, the absolute value of the determinants are smaller than or equal to ([log(n + k)/ log(2)] |A| )|A| |A|/2 . Since |A| ≤ π(k), we deduce, after multiplying by det(M (Q) ), that there exists a linear dependence between log(n + 1), . . . , log(n + k) involving only integers of absolute value at most D := [ π(k) log(n + k)/ log 2] π(k) : let us keep the notation of (1) for this dependence. Let q be the smallest nonnegative integer such that k j=1 j q m j = 0: from the fact that the Vandermonde matrices are invertible, one deduces that q ≤ k − 1. Using the fact that log(n + j) − log n + q r=1 (−1) r−1 j r rn r ≤ j q+1 (q + 1)n q+1 , we deduce, by writing the dependence above: Since the first factor in the left-hand side of these inequalities is a non-zero integer, it is at least 1. From the bounds we have on the m j 's, we deduce 1 qn q ≤ Dk q+2 (q + 1)n q+1 4 for q ≥ 1 and log n ≤ Dk 2 n .
This result implies that theoretically, for fixed k, one can find all the values of n such that (X n+1 , . . . , X n+k ) are not independent by brute force computation. In practice, the bound we have obtained is far from optimal, and is too poor to be directly useable except for very small values of k, for which a more careful reasoning can solve the problem directly. Here is an example for k = 5: Proposition 2.4. For n ≥ 1, the variables (X n+1 , X n+2 , X n+3 , X n+4 , X n+5 ) are independent except if n ∈ {1, 2, 3, 4, 5, 7}.
Proof. If 5 j=1 (n + j) m j = 1 with integers m 1 , . . . m 5 not all equal to zero, then m j = 0 as soon as n + j has a prime factor larger than or equal to 5: otherwise, this prime factor cannot be cancelled by the factors (n + k) m k for k = j. Hence, the values of n + j such that m j = 0 have only prime factors 2 and 3, and at most one of them has both factors since it should then be divisible by 6. Moreover, if n ≥ 4, there can be at most one power of 2 and one power of 3 among n + 1, . . . , n + 5. One deduces that dependence is only possible if among n + 1, . . . , n + 5, there are three numbers, respectively of the form 2 k , 3 ℓ , 2 r .3 s , for integers k, ℓ, r, s > 0. The quotient between two of these integers is between 1/2 and 2 since we here assume n ≥ 4. Hence, 2 k ≥ 2 r .3 s /2 ≥ 2 r and then k ≥ r. Similarly, 3 ℓ ≥ 2 r .3 s /2 ≥ 3 s , which implies ℓ ≥ s. The numbers 2 k and 2 r .3 s are then both divisible by 2 r ; since they differ by at most 4, r ≤ 2. The numbers 3 ℓ and 2 r .3 s are both divisible by 3 s , and then s ≤ 1. Therefore, 2 r .3 s ≤ 12 and n ≤ 11. If 9 ≤ n ≤ 11, the only possible values of n + j such that m j can be different from zero are 12 and 16, which are multiplicatively independent. If n = 8, the only possible values are 9 and 12, which are also independent, if n = 6, the values to consider are 8 and 9. The only remaining values of n are 1, 2, 3, 4, 5, 7, which are exceptions since 8 4 · 9 3 · 12 −6 = 6 −6 · 8 2 · 9 3 = 4 3 · 8 −2 = 3 2 · 4 · 6 −2 = 2 2 · 4 −1 = 1.
The results above give an upper bound, for fixed k, of the maximal value of n such that (X n+1 , . . . , X n+k ) are not independent. By considering two consecutive squares and their geometric mean, whose logarithms are linearly dependent, one deduces the lower bound ([k/2] − 1) 2 − 1 ≥ (k − 1)(k − 5)/4 for the maximal n. As written in a note by Dubickas [4], this bound can be improved to a quantity equivalent to (k/4) 3 , by considering the identity: In [4], as an improvement of a result of [27], it is also shown that for all ǫ > 0, the lower bound e log 2 k/[(4+ǫ) log log k] occurs for infinitely many values of k.
It would remain to check if there are dependences for n > 1000.

Independence in the case of roots of unity
We now suppose that (X p ) p≥1 are i.i.d., uniform on the set of q-th roots of unity, q ≥ 1 being a fixed integer. If q = 2, we get symmetric Bernoulli random variables. For all integers s ≥ 2, we will denote by µ s,q the largest divisor d of q such that s is a d-th power. The analog of Lemma 2.1 in the present setting is the following: Lemma 3.1. For n, k ≥ 1, the variables (X n+1 , . . . , X n+k ) are all uniform on the set of q-th roots of unity if and only if µ n+j,q = 1 for all j between 1 and k. They are independent if and only if the only k-tuple (m 1 , . . . , m k ), 0 ≤ m j < q/µ n+j,q such that which is equal to 1 if ℓv p (s) is divisible by q for all p ∈ P, and to 0 otherwise. The condition giving 1 is equivalent to the fact that ℓ is a multiple of q/(gcd(q, (v p (s)) p∈P )), which is q/µ s,q . Hence, X s is a uniform (q/µ s,q )-th root of unity, which implies the first part of the proposition. The variables (X n+1 , . . . , X n+k ) are independent if and only if for all m 1 , . . . , m k ∈ Z, Since X n+j is a uniform (q/µ n+j,q )-th root of unity, both sides of the equality depend only on the values of m j modulo q/µ n+j,q for 1 ≤ j ≤ k. This implies that we can assume, without loss of generality, that 0 ≤ m j < q/µ n+j,q for all j. If all the m j 's are zero, both sides are obviously equal to 1. Otherwise, the right-hand side is equal to zero, and then we have independence if and only if it is also the case of the left-hand side, i.e. for all (m 1 , . . . , We then have the following result, similar to Proposition 2.2: For fixed k, q ≥ 1, there exists an explicitely computable n 0 (k, q) such that (X n+1 , . . . , X n+k ) are independent as soon as n ≥ n 0 (k, q).
The bound n 0 (k, q) can be deduced from bounds on the solutions of certain diophantine equations which are available in the literature: we do not take care of its precise value, which is anyway far too large to be of any use if we want to find in practice the values of n such that (X n+1 , . . . , X n+k ) are not independent.
Proof. For each value of n ≥ 1 such that (X n+1 , . . . , X n+k ) are dependent, there exist 0 ≤ m j < q/µ n+j,q , not all zero, such that There are finitely many choices, depending only on k and q, for the k-tuples (µ n+j,q ) 1≤j≤k and (m j ) 1≤j≤k , so it is sufficient to show that the values of n corresponding to each choice of k-tuples is bounded by an explicitely computable quantity. At least two of the m j 's are non-zero: otherwise m j v p (n + j) is divisible by q for all p ∈ P, j being the unique index such that m j = 0, and then m j is divisible by q/µ n+j,q : this contradicts the inequality 0 < m j < q/µ n+j,q .
On the other hand, if p is a prime larger than k, at most one of the terms m j v p (n + j) is non-zero, and then all the terms are divisible by q, since it is the case for their sum.
We deduce that n + j is the product of a power of order ρ j := q/ gcd(m j , q) and a number A j whose prime factors are all smaller than k. Moreover, one can assume that A j is "ρ j -th power free", i.e. that all its p-adic valuations are strictly smaller than ρ j . Hence there exist The value of the exponents ρ j are fixed by the m j 's, and at least two of them are strictly larger than 1, since at least two of the m j 's are non-zero. Let us first assume that there exist distinct j and j ′ such that ρ j ≥ 2 and ρ j ′ ≥ 3. One finds an explicitly computable bound on n in this case as soon as we find an explicitly computable bound for the solutions of each diophantine equation in x and z: These equations can be rewritten as: This polynomial has all simple roots (the ρ j ′ -th roots of −d/A ′ ) and then at least two of them; it has at least three if ρ j = 2 since ρ j ′ is supposed to be at least 3 in this case. By a result of Baker [1], all the solutions are bounded by an explicitly computable quantity, which gives the desired result (the same result with an ineffective bound was already proven by Siegel).
In remains to deal with the case where ρ j = 2 for all j such that m j = 0. In this case, q is even and m j is divisible by q/2, which implies that m j = q/2 when m j = 0. By looking at the prime factors larger than k, one deduces that for all j such that m j = 0, n + j is a square times a product of distinct primes smaller than or equal to k. If at least three of the m j 's are non-zero, it then suffices to find an explicitly computable bound for the solutions of each system of diophantine equations: From these equations, we deduce, for x = BCyz: . The four roots of the right-hand side are the square roots of −d 1 /A and −d 2 /A, which are all distinct since d 1 = d 2 , d 1 = 0, d 2 = 0. Again by Baker's result, one deduces that the solutions are explicitly bounded, which then gives an explicit bound for n.
The remaining case is when exactly two of the m j 's are non-zero, with ρ j = 2, and then m j = q/2. The dependence modulo q then means that (n + j)(n + j ′ ) is a square for distinct j, j ′ between 1 and k, which implies that (n + j)/g and (n + j ′ )/g are both squares where g = gcd(n + j, n + j ′ ). These squares have difference smaller than k, which implies that they are smaller than k 2 . Moreover, g divides |j − j ′ | ≤ k, and then g ≤ k, which gives n ≤ k 3 .
Proof. A dependence means that there exists a product of distinct non-square integers among n + 1, . . . , n + 5 which is a square. For a prime p ≥ 5, at most one p-adic valuation is non-zero, which implies that all the p-adic valuations are even. Hence, the factors involved in the product are all squares multiplied by 2, 3 or 6. Since they differ by at most 4, they cannot be in the same of the three "categories", which implies, since the product is a square, that there exist three numbers, respectively of the form 2x 2 , 3y 2 , 6z 2 , in the interval between n + 1 and n + 5. Now, Hajdu and Pintér [6] have determined all the triples of distinct integers in intervals of length at most 12 whose 8 product is a square. For length 5, the only positive triple is (2,3,6), which implies that the only dependence in the present setting is X 2 X 3 X 6 = 1.
Remark 3.4. The list given in [6] shows that for q = 2, there are dependences for quite large values of n as soon as k ≥ 6. For example, we have X 240 X 243 X 245 = 1 for k = 6 and X 10082 X 10086 X 10092 = 1 for k = 11.

Convergence of the empirical measure in the uniform case
In this section, (X p ) p∈P are uniform on the unit circle, and k ≥ 1 is a fixed integer. For N ≥ 1, we consider the empirical measure of the N first k-tuples: It is reasonable to expect that µ k,N tends to the uniform distribution on U k , which is the common distribution of (X n+1 , . . . X n+k ) for all but finitely many values of n. In order to prove this result, we will estimate the second moment of the Fourier transform of µ k,N , given bŷ and there exists C m 1 ,...,m k ≥ 0, independent of N and N ′ , such that Moreover, under the same assumption, Proof. We have, using the completely multiplicative extension of X r to all r ∈ Q * + : and then the left-hand side is equal to the number of couples (n 1 , The number of trivial solutions n 1 = n 2 of this equation is equal to N − N ′ , which gives a lower bound on the second moment we have to estimate. On the other hand, the derivative of the rational fraction k j=1 (X +j) m j can be written as the product of k j=1 (X +j) m j −1 , which is strictly positive on R + , by the polynomial The polyomial Q has degree at most k − 1 and is non-zero, since (m 1 , . . . , m k ) = (0, . . . , 0) and then k j=1 (X + j) m j is non-constant. We deduce that Q has at most k − 1 zeros, and then on R + , k j=1 (X + j) m j is strictly monotonic on each of at most k intervals of R + , whose bounds are 0, the positive zeros of Q and +∞. Hence, for each choice of n 1 , there are at most k values of n 2 satisfying (2), i.e. at most one in each interval, which gives the upper bound k(N − N ′ ) for the moment we are estimating.
Moreover, since k j=1 (X + j) m j is strictly monotonic on an interval of the form [A, ∞) for some A > 0, we deduce that for any non-trivial solution (n 1 , n 2 ) of (2), the minimum of n 1 and n 2 is at most A. Hence, there are finitely many possibilities for the common value of the two sides of (2), and for each of these values, at most k possibilities for n 1 and for n 2 . Hence, for fixed (m 1 , . . . , m k ), the total number of non-trivial solutions of (2) is finite, which gives the bound N − N ′ + C m 1 ,...,m k of the proposition.
The statement involving the empirical measure is deduced by taking N ′ = 0 and by dividing everything by N 2 .
The claim for k ≤ 3 is an immediate consequence of the following statement we will prove now: the only integers n 1 > n 2 ≥ 1, (m 1 , m 2 , m 3 ) = (0, 0, 0), such that are n 1 = 7, n 2 = 2, (m 1 , m 2 , m 3 ) proportional to (2, 1, −4), which corresponds to the equality: If m 1 , m 2 , m 3 have the same sign and are not all zero, (n + 1) m 1 (n + 2) m 2 (n + 3) m 3 is strictly monotonic in n ≥ 1, and then we cannot get a solution of (3) with n 1 > n 2 . By changing all the signs if necessary, we may assume that one of the integers m 1 , m 2 , m 3 is strictly negative and the others are nonnegative. For n ≥ 1, the fraction obtained by writing (n + 1) m 1 (n + 2) m 2 (n + 3) m 3 can only be simplified by prime factors dividing two of the integers n + 1, n + 2, n + 3, and then only by a power of 2. If m 2 < 0 and then m 1 , m 3 ≥ 0, the numerator and the denominator have different parity, and then the fraction is irreducible for all n: we do not get any solution of (3) in this case. Otherwise, m 1 or m 3 is strictly negative. If (n 1 , n 2 ) solves (3), let us define s := 1 and j := n 2 + 1 if m 1 < 0, and s := −1 and j := n 2 + 3 if m 3 < 0. The denominators of the two fractions corresponding to the two sides of (3) are respectively a power of j and the same power of n 1 + 2 − s: if (3) is satisfied, these denominators should differ only by a power of 2, since the fractions can be only simplified by such a power. Hence, n 1 + 2 − s = 2 ℓ j for some ℓ ≥ 0, and by looking at the numerators of the fractions, we deduce that there exists r ≥ 0 such that If ℓ ≥ 2, the ratios (2 ℓ j + s)/(j + s) and (2 ℓ j + 2s)/(j + 2s) are at least (4 · 2 + 2)/(2 + 2) = 5/2 since j ≥ n 2 + 1 ≥ 2 and |2s| ≤ 2, and then the ratio between the right-hand side and the left-hand side of the previous equality is at least (5/2) m 2+s +m 2 2 −r , which gives On the other hand, the 2-adic valution of the right-hand side is m 2+s since 2 ℓ j + 2s ≡ 2 modulo 4, whereas the valuation of the left-hand side is at least r, which gives 2 r ≤ 2 m 2+s . 10 We then get a contradiction for ℓ ≥ 2, except in the case m 2+s = m 2 = 0, where we already know that there is no solution of (3). If ℓ = 1, we get 2 r (j + s) m 2 (j + 2s) m 2+s = (2j + s) m 2 (2j + 2s) m 2+s .
In this case, the prime factors of 2j + s, which are odd (|s| = 1), should divide j + s or j + 2s, then 2j + 2s or 2j + 4s, and finally s or 3s. Hence, 2j + s is a power of 3. Similarly, the odd factors of j + 2s, and then of 2j + 4s, should divide 2j + s or 2j + 2s, and then s or 3s: 2j + 4s is the product of a power of 2 and a power of 3. If we write 2j + s = 3 a , 2j + 4s = 2 b 3 c , we must have |3 a − 2 b 3 c | = 3. If a ≤ 1, we have 2j + s ≤ 3. If s = 1, we get n 2 + 1 = j ≤ 1, and if s = −1, we get n 2 + 3 = j ≤ 2, which is impossible. If a ≥ 2, 3 a is divisible by 9, and then 2 b 3 c is congruent to 3 or 6 modulo 9, which implies c = 1, and then |3 a−1 − 2 b | = 1. Now, by induction, one proves that the order of 2 modulo 3 a−1 is equal to 2.3 a−2 (i.e. 2 is a primitive root modulo the powers of 3). This result is classical, and can be deduced, for example, from Rosen [21], Theorem 8.9. For sake of completeness, we give a proof here. The result is easy to check be direct computation for a = 2 and a = 3. Let us assume that it is true for all values until a ≥ 3. The order of 2 modulo 3 a is a multiple of the order of 2 modulo 3 a−1 , and then a multiple of 2.3 a−2 by assumption. On the other hand, it is a divisor of 2.3 a−1 by Euler's theorem. Hence, it is either 2.3 a−2 or 2.3 a−1 . Moreover, since 2.3 a−3 is assumed to be the order of 2 modulo 3 a−2 but strictly smaller than the order of 2 modulo 3 a−1 , we have where u is not divisible by 3. Raising to the cube, we deduce is not divisible by 3 (recall that a ≥ 3 here). Hence, the order of 2 modulo 3 a is not 2.3 a−2 : it can only be 2.3 a−1 , which proves by induction that 2 is a primitive root of 3 a−1 for all a ≥ 2. Now, in the present situation, the order of 2 modulo 3 a−1 , i.e. 2.3 a−2 , should divide 2b, since 2 b ≡ ±1 modulo 3 a−1 , and then b ≥ 3 a−2 (b = 0 is not possible) which implies 2 3 a−2 ≤ 3 a−1 + 1, i.e. a ∈ {2, 3}. If a = 2 and s = 1, we get 2j + 1 = 9, j = 4, and then n 1 = 7, n 2 = 3. We should solve 4 m 1 5 m 2 6 m 3 = 8 m 1 9 m 2 10 m 3 . Taking the 3-adic valuation gives m 3 = 2m 2 , taking the 5-adic valuation gives m 3 = m 2 , and then m 2 = m 3 = 0, which implies m 1 = 0.
In this setting, we also have a strong law of large numbers, with an estimate of the rate of convergence, for sufficiently smooth test functions. Before stating the corresponding result, we will show the following lemma, which will be useful: Lemma 4.3. Let ǫ > δ ≥ 0, C > 0, and let (A n ) n≥0 be a sequence of random variables such that A 0 = 0 and for all N > N ′ ≥ 0, Then, almost surely, A N = O(N 1/2+ǫ ): more precisely, we have for M > 0, where K ǫ,δ > 0 depends only on δ and ǫ.
From this lemma, we deduce the following: Proposition 4.4. Almost surely, µ k,N weakly converges to µ k . More precisely, the following holds with probability one: for all u > k/2, for all continuous functions f from U k to C such that m∈Z k |f (m)| ||m|| u < ∞, || · || denoting any norm on R k , and for all ǫ > 0,

Remark 4.5. By Cauchy-Schwarz inequality, we have
, which implies that the assumption on f given in the proposition is satisfied for all f in the Sobolev space H s as soon as s > k.
Unfortunately, the proposition does not apply if f is a product of indicators of arcs. The weak convergence implies that For fixed u > k/2, we apply this estimate to M = ||m|| u and get Since −2u < −k, we deduce, by Borel-Cantelli lemma, that almost surely, for m ∈ Z k \{0}, N ≥ 1. Almost surely, this estimates simultaneously occurs for all rationals u > k/2 and ǫ > 0 (with a random implicit constant in O, depending on u and ǫ) and then for all reals u > k/2 and ǫ > 0.
Let us now assume that this almost sure property holds, let us fix u > k/2, ǫ > 0, and let f be a function satisfying the assumptions of the proposition. Since the Fourier coefficients of f are summable (i.e. f is in the Wiener algebra of U k ), the corresponding Fourier series converges uniformly to a function which is necessarily equal to f , since it has the same Fourier coefficients. We can then write: (m)μ k,N (m). 13 By assumption, the last sum is dominated by which is finite by the assumptions made in the proposition, and then O(N −1/2+ǫ ).

Moments of order different from two
Since we have a law of large numbers on µ k,N , with rate of decay of order N −1/2+ǫ , it is natural to look if we have a central limit theorem. In order to do that, a possibility consists in studying moments of sums in n of products of variables from X n+1 to X n+k . For the sums N n=1 X n , we do not have convergence to a non-zero Gaussian random variable after normalization by 1/ √ N . Indeed, the second moment of the absolute value of the renormalized sum 1 √ N N n=1 X n is equal to 1, so if this variable converges to a non-zero complex Gaussian variable, we need to have the convergence of X n towards a non-zero constant. In [12], Harper, Nikeghbali and Radziwi l l prove that the quantity just above decays at most like (log log N ) −3+o (1) when N goes to infinity, whereas a conjecture by Helson [14] states that it tends to 0. The order of magnitude of the left-hand side has later been found by Harper in [10]: it is (log log N ) −1/4 , which in particular proves Helson's conjecture. On the other hand, an equivalent of the moments of 1 √ N N n=1 X n of even integer order are computed in [12] and [13], and they are not bounded with respect to N : the moment of order 2p is equivalent to an explicit constant times (log N ) (p−1) 2 . The order of magnitude of the moments of any positive order, not necessarily integer, is given by Harper in [10] and [11].
In the case of sums different from N n=1 X n , the moment computations involve arithmetic problems of different nature: here, we look in some detail the case of the sum N n=1 X n X n+1 . In this case, the fact that consecutive, and then necessarily coprime integers are involved gives more independence than when we study the sum N n=1 X n . In particular, it seems reasonable to expect that N n=1 X n X n+1 satisfies the same central limit theorem as the sum of i.i.d. uniform variables on the unit circle, and that this fact can be proven by moment computations. The convergence of the second moment is obvious, and we will now show that the convergence of the fourth moment also occurs. We start with the following result: where N (N ) (resp. N = (N )) is the number of solutions of the diophantine equation a(a + 1)d(d + 1) = b(b + 1)c(c + 1) such that the integers a, b, c, d satisfy 0 < a < b < c < d ≤ N (resp. 0 < a < b = c < d ≤ N ). Moreover, for all ǫ > 0, there exists C ǫ > 0, independent of N , such that for all N ≥ 8, Proof. Expanding the fourth moment, we immediately obtain that it is equal to the total number of solutions of the previous diophantine equation, with a, b, c, d ∈ {1, 2, . . . , N }. One has 2N 2 − N trivial solutions: It remains to count the number of non-trivial solutions. Such a solution has a minimal element among a, b, c, d. This element is unique: if two minimal elements are on the same side, then necessarily a = b = c = d, if two minimal elements are on different sides, then the other elements should be equal, which also gives a trivial solution. Dividing the number of solutions by four, we can assume that a is the unique smallest integer, which implies that d is the largest one. For b = c, we get N = (N ) solutions, and for b = c, we get 2N = (N ) solutions, the factor 2 coming from the possible exchange between b and c.
Let us now prove the upper bound. We start by slightly simplifying the equation by introducing the odd integers A = 2a + 1, B = 2b + 1, C = 2c + 1, D = 2d + 1, which should satisfy: If A, B, C, D are large, then AD and BC should be odd and close to each other. It is then quite natural to introduce δ := (AD − BC)/2, which is expected to be small with respect to A, B, C, D. More precisely, since B and C are closer to each other than A and D, we need and then δ > 0, since The last equality, gives, after factorizing the left-hand side and replacing BC by AD − 2δ: and in particular A 2 − 2(2δ + 1)AD + D 2 + 4δ(δ + 1) = (B − C) 2 ≥ 0. If we neglect the term 4δ(δ + 1), expected to be small with respect to AD, we get the positivity of a quadratic form in A and D, which gives a restriction on the possible values of the ratio D/A. More precisely, if we assume 1 < D/A ≤ 2δ + 2, we deduce and then AD ≤ 2δ + 1 since it is an odd integer, and then BC = AD − 2δ ≤ 1, which gives a contradiction. Any solution should then satisfy D/A > 2δ + 2. We now discuss in function of the value of δ.  for (b, c) when a and d are chosen. Hence, the number of solutions for δ > √ N is bounded by the estimate we have claimed. It remains to bound the number of solutions for δ ≤ √ N : we will get a bound for the number of solutions for each value of δ, which will be multiplied by √ N at the end. Each solution should satisfy A 2 − 2(2δ + 1)AD + D 2 + 4δ(δ + 1) = (B − C) 2 , i.e. by writing the quadratic form in A and D as a difference of squares: We know that D ≥ A(2δ + 2), and then 0 < D − (2δ + 1)A ≤ 2N + 1, which gives, for each value The claim we have admitted is a consequence of the following fact we will prove now: for ǫ > 0, the number of representations of M in integers by the quadratic form X 2 +P Y 2 is O(M ǫ ), uniformly in the strictly positive integer P . Indeed, for such a representation, the ideal (X + Y √ −P ) should be a divisor of (M ) in the ring of integers O P of Q[ √ −P ], and each such ideal gives at most 6 couples (X, Y ) representing M . Indeed, the group of invertible elements in O P has order at most 6. This fact is classical (see for example Jarvis [16], Chapter 6), and can be proven as follows: if is an integer since it is in O P , whereas is an invertible integer, necessarily equal to 1. Hence, α + β √ −P is a complex number of modulus 1, with real part equal to −1, −1/2, 0, 1/2 or 1, i.e. a fourth root or a sixth root of unity. We now only need to bound the number of divisors of (M  Remark 5.2. Using the previous proof, one can show the following quite curious property: all the solutions of a(a + 1)d(d + 1) = b(b + 1)c(c + 1) in integers 0 < a < b ≤ c < d satisfy d/a > 3 + 2 √ 2. Indeed, let us assume the contrary. With the previous notation, 3 + 2 √ 2 ≥ d/a ≥ D/A > 2δ + 2, and then δ = 1, which gives A 2 − 6AD + D 2 + 8 ≥ 0, i.e.
A consequence of the previous proposition corresponds to a bound on all the moments of order 0 to 4: where c q = 2 −(q−1) − ≥ 1/2 and C q = 2 (q−1) + ≤ 2.
Proof. Hölder inequality implies that the logarithm of the 2q-th moment of a nonnegative random variable is a convex function of q. Now, we have proven that this logarithm is equal to 0 for q = 0 and q = 1 and to ln 2 + o(1) for q = 2. The corollary can now be deduced from the following fact, easy to check: if f is a convex fonction from [0, 2] to R such that f (0) = f (1) = 0, f (2) = 1, then We have proven that the fourth moment of 1 √ N N n=1 X n X n+1 converges to 2, which is also the limit of the fourth moment of 1 √ N N n=1 Z n where (Z n ) n≥1 are i.i.d. random variables, uniform on the unit circle. Unfortunately, we are not able to prove a similar convergence for higher moments, and then we do not know how to prove a central limit theorem. However, the following result holds: Proposition 5.4. If for all integers q ≥ 1, the number of non-trivial solutions (n 1 , . . . , n 2q ) ∈ {1, . . . , N } 2q of the diophantine equation q r=1 n r (n r + 1) = q r=1 n q+r (n q+r + 1) is negligible with respect to the number of trivial solutions when N → ∞ (i.e. o(N q )) then we have where N C denotes a standard Gaussian complex variable, i.e. (N 1 + iN 2 )/ √ 2 where N 1 , N 2 are independent standard real Gaussian variables.
If 0 ≤ q 1 < q 2 , there are at most N q 1 choices for n 1 , . . . , n q 1 , and once these integers are fixed, at most N o(1) choices for n q 1 +1 , . . . , n q 1 +q 2 by the divisor bound. Hence, the moment tends to zero when N → ∞, and we have the same conclusion for 0 ≤ q 2 < q 1 . Finally, if 0 ≤ q 1 = q 2 = q, by assumption, the moment is equivalent to N −q times the number of trivial solutions of the corresponding diophantine equation, i.e. to the corresponding moment for the sum of i.i.d. variables, uniform on the unit circle. By the central limit theorem, We have then proven that for all integers q 1 , q 2 ≥ 0, which gives the claim.
We have proven the assumption of the previous proposition for q ∈ {1, 2}, however, our method does not generalize to larger values of q. The divisor bound gives immediately a domination by N q+o(1) for the number of solutions, and then it seems reasonable to expect that the arithmetic constraints implied by the equation are sufficient to save at least a small power of N . Note that the situation is different for the sum N n=1 X n : for example, for q = 2, the number of non-trivial solutions of the equation n 1 n 2 = n 3 n 4 for 1 ≤ n 1 , n 2 , n 3 , n 4 ≤ N is not o(N 2 ), as we can see by considering the equalities a(2b) = b(2a) for a and b odd, a < b.
The previous proposition giving a "conditional CLT" can be generalized to the sums of the form Here, we suppose that (X p ) p∈P are i.i.d. uniform on the set U q of q-th roots of unity, q ≥ 1 being fixed. With the notation of the previous section, we now get: Proposition 6.1. Let m 1 , . . . , m k be integers, not all divisible by q, let ǫ > 0 and let N > N ′ ≥ 0. Then, and E |μ k,N (m 1 , . . . , m N )| 2 ≤ C q,k,ǫ N 1−ǫ , where C q,k,ǫ > 0 depends only on q, k, ǫ.
Proof. We can obviously assume that m 1 , . . . , m k are between 0 and q −1, which gives finitely many possibilities for these integers, depending only on q and k. We can then suppose that m 1 , . . . , m k are fixed at the beginning. We have to upper bound the number of couples (n 1 , n 2 ) on {N ′ + 1, . . . , N } 2 such that where, in this proof, (Q * + ) q denotes the set of q-th powers of positive rational numbers. Now, any positive integer r can be decomposed as a product of a "smooth" integer whose prime factors are all strictly smaller than k, and a "rough" integer whose prime factors are all larger than or equal to k. If the "rough" integer is denoted ♯ k (r), the condition just above implies: Now, the numerator and the denominator of this expression can both be written in a unique way as a product of a q-th perfect power and an integer whose p-adic valuation is between 0 and q − 1 for all p ∈ P. If the quotient is a q-th power, necessarily the numerator and the denominator have the same "q-th power free" part. Hence, there exists a q-th power free integer g such that N q being the set of q-th powers of positive integers. Hence, the number of couples (n 1 , n 2 ) we have to estimate is bounded by g≥1,q -th power free where N (q, k, g, N ′ , N ) is the number of integers n ∈ {N ′ + 1, . . . , N } such that If a prime number p ∈ P divides n + j and n + j ′ for j = j ′ ∈ {1, . . . , k}, it divides |j − j ′ | ∈ {1, . . . , k − 1}, and then p < k. Hence, the rough parts of (n + j) m j are pairwise coprime. Now, if g 1 , . . . , g k are the q-th power free integers such that ♯ k [(n + j) m j ] ∈ g j N q , we have g 1 g 2 . . . g k ∈ gN q . Now, g 1 , . . . , g k are coprime, and then g 1 g 2 . . . g k is q-th power free, which implies g 1 . . . g k = g. Hence Let us now fix an index j 0 such that m j 0 is not multiple of q. We have where rad(g j ) denotes the product of the distinct prime factors of g j . The condition on (n + j 0 ) m j 0 means that for all p ∈ P, p ≥ k, i.e. v p (g j 0 ) is divisible by gcd(m j 0 , q) and (m j 0 / gcd(m j 0 , q))v p (n + j 0 ) ≡ v p (g j 0 )/ gcd(m j 0 , q) (mod. ρ j 0 ), where ρ j 0 := q/ gcd(m j 0 , q). Since m j 0 / gcd(m j 0 , q) is coprime with ρ j 0 , the last congruence is equivalent to a congruence modulo ρ j 0 between v p (n + j 0 ) and a fixed integer, which is not divisible by ρ j 0 if and only if p divides g j 0 . We deduce that the condition on (n + j 0 ) m j 0 implies that ♯ k (n + j 0 ) ∈ h(q, m j 0 , g j 0 )N ρ j 0 , i.e.
where α is a ρ j 0 -th power free integer whose prime factors are strictly smaller than k, A is an integer and h(q, m j 0 , g j 0 ) is an integer depending only on q, m j 0 and g j 0 , which is divisible by rad(g j 0 ). For a fixed value of α, the values of A should be in the interval whose size is at most , by the concavity of the power 1/ρ j 0 , the fact that ρ j 0 ≥ 2 since m j 0 is not divisible by q, which implies x 1/ρ j 0 ≤ 1 + √ x. Now, the conditions on n + j for j = j 0 imply a condition of congruence for αh(q, m j 0 , g j 0 )A ρ j 0 , modulo all the primes dividing one of the g j 's for j = j 0 . These primes do not divide α, since α has all prime factors smaller than k, and g j divides ♯ k [(n + j) m j ]. They also do not divide h(q, m j 0 , g j 0 ), since this integer has the same prime factors as g j 0 , which is prime with g j . Hence, we get a condition of congruence for A ρ j 0 modulo all primes dividing g j for some j = j 0 . For each of these primes, this gives at most ρ j 0 ≤ q congruence classes for A, and then, by the chinese reminder theorem, we get at most q ω j =j 0 g j classes modulo j =j 0 rad(g j ), where ω denotes the number of prime factors of an integer. The number of integers A ∈ I satisfying the congruence conditions is then at most: where τ (g) denotes the number of divisors of g. Now, α has prime factors smaller than k and p-adic valuations smaller than q, which certainly gives α ≤ (k!) q . Hence, by considering all the possible values of α, and all the possible g 1 , . . . , g k , which should divide g, we deduce Using the divisor bound, we deduce that for all ǫ > 0, there exists C q,k,ǫ such that for all g ≤ (1 + k) kq N kq , 2(k!) q [τ (g)] k+(log q/ log 2) ≤ C (1) q,k,ǫ N ǫ , and then q,k,ǫ N ǫ (N − N ′ ) 1/2 (rad(g)) −1/2 which implies q,k,ǫ N ǫ (N − N ′ ) 1/2 (rad(g)) −1/2 since the right-hand side is nonnegative. Summing the square of this bound for all possible g gives g≥1,q -th power free Now, since all numbers up to (1+k) kq N kq have prime factors smaller than this quantity, we deduce, using the multiplicativity of the radical: g≥1,q -th power free which, by Mertens' theorem, is smaller than a constant, depending on k and q, times log q−1 (1 + N ). We deduce that there exists a constant C (2) q,k,ǫ > 0, such that g≥1,q -th power free since this sum counts all the integers n from N ′ + 1 to N , regrouped in function of the q-th power free part of ♯ k k j=1 (n + j) m j . Using the inequality x 2 ≤ (x− a) 2 + + 2ax, available for all a, x ≥ 0, we deduce g≥1,q -th power free This result gives the first inequality of the proposition, for C q,k,ǫ = C (2) q,k,ǫ/3 + 2C (1) q,k,ǫ/3 . The second inequality is obtained by taking N ′ = 0 and dividing by N 2 .
Corollary 6.2. For all (m 1 , . . . , m k ) ∈ Z k ,μ k,N (m 1 , . . . , m k ) converges in L 2 , and then in probability, to the corresponding Fourier coefficient of the uniform distribution µ k,q on U k q . In other words, µ k,N converges weakly in probability to µ k,q .
Since we have finitely many values of m 1 , . . . , m k , we can take the O uniform in m 1 , . . . , m k . Then, by inverting discrete Fourier transform on U k q , we deduce the claim.

More general distributions on the unit circle
In this section, (X p ) p∈P are i.i.d., with any distribution on the unit circle. We will study the empirical distribution of (X n ) n≥1 , but not of the patterns (X n+1 , . . . , X n+k ) n≥1 for k ≥ 2. More precisely, the goal of the section is to prove a strong law of large numbers for N −1 N n=1 δ Xn when N goes to infinity. We will use the following result, due to Halász, Montgomery and Tenenbaum (see [7], [8], [5], [20], [28] p. 343): Then: where C > 0 is an absolute constant.
From this result, we show the following: Proof. First, we observe that for 1 < N ′ < N integers, λ > 0, where, by a classical refinement of the prime number theorem, for all A > 1. The bracket is dominated by 1/ log(N ′ ), the second part of the last integral is dominated by Now, the integral of (sin y)/y on R * + is conditionally convergent: (sin y)/y tends to 1 when y → 0 and the convergence of the integral at ∞ is easily deduced from an integration by parts. Hence, the integral of (sin y/y) on any interval of R * + is uniformly bounded, which implies ℑ(I N ′ ,N,λ ) = O(1).
We deduce Bounding the sum on primes smaller than N ′ by taking the absolute value, we get: If we define, for k ≥ 1, N k as the integer part of e k 1/5 , we deduce, by Borel-Cantelli lemma, that almost surely, for all but finitely many k ≥ 1, max |λ|≤log 10 N k p∈P,p≤N k ℜ[(Y p − ρ)p −iλ ] p ≤ (log log N k ) 3/4 + O(1).
If this event occurs, we deduce, using (5), min |λ|≤log 10 N k p∈P,p≤N Then, by Proposition 7.1, we get  (1) ), 24 which gives the claimed result along the sequence (N k ) k≥1 . Now, if N ∈ [N k , N k+1 ], we have, since all the Y n 's have modulus at most 1, This allows to remove the restriction to the sequence (N k ) k≥1 .
Using Fourier transform, we deduce a law of large numbers for the empirical measure µ N = 1 N N n=1 δ Xn , under the assumptions of this section. Proposition 7.3. If for all integers q ≥ 1, P[X 2 ∈ U q ] < 1, then almost surely, µ N tends to the uniform measure on the unit circle.
Proof. For all m = 0, X m 2 takes its values on the unit circle, and it is not a.s. equal to 1. Applying the previous proposition to Y n = X m n , we deduce thatμ N (m) tends to zero almost surely, which gives the desired result.
Proposition 7.4. If for q ≥ 2, X 2 ∈ U q almost surely, but P[X 2 ∈ U r ] < 1 for all strict divisors r of q, then almost surely, µ N tends to the uniform measure on U q . More precisely, almost surely, for all t ∈ U q , the proportion of n ≤ N such that X n = t is q −1 + O((log N ) −c ), as soon as this infimum being strictly positive.
Proof. The infimum is strictly positive since by assumption, P[X m 2 = 1] < 1 for all m ∈ {1, . . . , q − 1}. Now, we apply the previous result to Y n = X m n for all m ∈ {1, . . . , q − 1}, and we get the claim after doing a discrete Fourier inversion.