SEQUENCES IN POWER RESIDUE CLASSES

Using A. Well's estimates the authors have given bounds for the largest prime P0 such that all primes p>P0 have sequences of quadratic residues of length m. For m≤8 the smallest prime having m consecutive quadratic residues is ≡3(mod4) and P0≡1(mod4). The reason for this phenomenon is investigated in this paper and the theory developed is used to successfully uncover analogous phenomena for rth power residues, r≥2, r even.

I. INTRODUCTION.In [I] the authors used Well's estimates [2] to give explicit bounds for the largest prime P0 such that all primes P P0 have sequences of quadratic residues of pre- assigned length m.Unexpectedly, the authors discovered that for all m < 8 the smallest primes having m consecutive quadratic residues are congruent to 3(mod r) and that P 0 is l(mod 4).
In this paper we develop a theory which suggests that primes E 3(mod 4) can be expected to have a longest sequence of quadratic residues (or non residues) which is, in the mean, approximately one longer that the longest sequence for primes l(mod 4) of conparable size.Data in Table support this theory.
Using our theory we predicted that primes 5(mod 8) can be expected to have a longest sequence of quadratic residues which is, in the mean, about I/2 longer than the longest sequence for primes l(mod 8) of comparable size.This is supported by data in Table 2.In Table 5 we observe that (as aconsequence) the smallest primes E l(mod 4) having a sequence of 1,2,3 I0 consecutive quadratic residues, respectively, are all E 5(mod 8) rather than l(mod 8).
The data in Tables 3 and 4 support our theory regarding the approximate magnitude th of the mean excesses in the lengths of the longest r power residue sequences, r 2 and even, for primes E r+l (mod 2r) versus the corresponding mean lengths for prime E l(mod 2r); data is supplied for r 6,8.
Additional supporting'material can be obtained from the first author in [3] where th data for all cosets formed with respect to the subgroup of r powers (mod p) is presented and the mean value of the longest sequence in any coset is observed to be closely approximated by logrp for all integers r _> 2, 70,000 < p < 300,000; see Table 6.

NOTATION. th
For each fixed r let n(p) denote the length of the longest sequence of r power residues modulo the prime p which, as customary, we take to be E l(mod r).We let m(g) be the smallest prime p such that n(p) and m(g) the largest prime such that n(p) 3. RANDOM SEQUENCES OF ZEROS AND ONES.
Consider all n-character strings of t zeros and n-t ones.For convenience we shall call a substring of E or more consecutive zeros an E-substring.If X is an event which is a function of a variable x and which happens with probability P(X) we shall say that X happens almost surely if P(X) tends to as x tends to infinity.
Let R(n,,t) denote the number of n-character strings with t zeros and n-t ones which do not contain and -substring.
The recursion for part (a) is easy.If we append a "l" to and n-character string with no -substring then we get an (n+l)-character string with no -substring, accounting for the addend R(n,,t).If we append a "0" to an n-character string with no -substring then we get an (n+i)-character string which has no -substring unless the original string ended with -1 zeros, accounting for the second and thrird addends on the right-hand-side of formula (a).
To prove (b) we use the two variable generating function Using the recursion in (a) and taking into account the "initial conditions" we get where (; G(y) (l-yE)/(1-y).The remainder of the proof is easily supplied by the reader using simple algebra to extract coefficients.
Let s(n,E,t) denote the number of n-character strings with t zeros and n-t other digits, 0 through r-l, with no E-substring.We may omit the proof of the following theorem as its proof is entirely similar to the above.
Let v(n) denote the length of the longest -substring and w(n) denote any function such that w(n) tends to infinity as n tends to infinity.THEOREM 3.3 Consider an arbitrary n-character string having t zeros.
(a) Let X be the event that there exists at least one -string.Then P(X I) < n().
(b) If n rt then v(n) logr(n)+w(n) almost surely does not happen.
(c) Let X 2 be the event that there exists no -substrlng.Then P(E 2) PROOF.
(a) The probability that at least one -substrings.Thus n- Henceforth, we assume the easy inequality t-I t for n t > i 0, n-i n from which it follows that a < (t/n) so that P(X I) < n(t/n) (b) Let n rt and apply part (a).Then P(X I) < n() n(r-).
--w(n) r /n.As n tends to infinity, If log r(n) + w(n), then r P(X I) r -w(n) tends to zero.
(c) Let X be the number of -substrings.Using an appropriate version of Chebyshev's inequality we have E(X2) I.
(n-2 +l+i)(t_2+i) + (n-+l)(t_).(n-)a2 a2 < a so that Summing the geometric series completes the proof of (c).(d) Let n rt so that by part (c) 2r (r-l) Then there is a constant m such that < m log n so that

CONSEQUENCES OF 3. th
We can visualize coset membership formed with respect to the subgroup of r powers (mod p) as a string of digits, each digit from the range 0 to r-l, with 0 corre- th sponding to the r powers.These strings are clearly not randomly determined.None- theless the theory in 3 suggests that to the extent that n(p) can be thought of as a random variable we should expect its mean value to be on the order of logrp.Specifically, in Table 6 we give coefficients a and b produced by a linear least squares fit of n(p) to n(p) m In p+b.
Tables to 6 illustrate the central feature of this note.If r is even and th 2 then we have (p-l)/2r r powers (and similarly for the other r-1 cosets formed th with respect to the subgroup of r powers (mod p)) in the interval to (p-l)/2 if p l(mod 2r) and in the interval to p-1 if p r+l(mod 2r).Data in the following tables suggest that mean lengths of n(p) for primes r+1(mod 2r) exceed those for primes E 1(mod 2r) by in 2/in r for r even and 2. The mean dif- ference of I, e.g., for r=2 translates into an expected value for n(p) for p 3(mod 4) equal to the expected value for N(q) for a prime l(mod 4) approxi- mately twice the size of p.
The theory which allows us to conjecture approximate mean differences in n(p) between the residue classes produces estimates which are startlingly close to actual data given the obvious differences between r th power residue distributions and random character strings.However, our theory represents only a partial first hypothesis, and a superior explanation for the phenomenon described here may well be developed.Nonetheless statistical tests (see [4] for the standard Z-test) provides better than 99% confidence that primes l(mod 2r) and primes r+l(mod 2r), r=2,4,6,8, constitute two entirely different sample populations.
Of course this note raises a number of questions, many very difficult.Even for r 2 it is not at all obvious for large % whether the probability that m() 3(mod 4) and m(E) E 1(mod 4) increases or decreases or even has a limit as % goes to infinity.
5. COMPUTATION.Originally computations were done in VS FORTRAN (IBM's FORTRAN 77) on the IBM 3033N of the System Network Computer Center at Louisianna State University.
The computation was redone, also in FORTRAN, on the VAX 11/780 running VMS of the Department of Computer Science at L.S.U.Most of the statistical results were obtained using SAS on the IBM 3033.