CHARACTER SUMS AND CONGRUENCES WITH n!

Similar documents
When do Fibonacci invertible classes modulo M form a subgroup?

#A37 INTEGERS 15 (2015) NOTE ON A RESULT OF CHUNG ON WEIL TYPE SUMS

When do the Fibonacci invertible classes modulo M form a subgroup?

Almost All Palindromes Are Composite

Aliquot sums of Fibonacci numbers

ON THE SET a x + b g x (mod p) 1 Introduction

A CLASS OF ALGEBRAIC-EXPONENTIAL CONGRUENCES MODULO p. 1. Introduction

ON THE LEAST SIGNIFICANT p ADIC DIGITS OF CERTAIN LUCAS NUMBERS

An Estimate For Heilbronn s Exponential Sum

Distribution of Matrices with Restricted Entries over Finite Fields

CERIAS Tech Report The period of the Bell numbers modulo a prime by Peter Montgomery, Sangil Nahm, Samuel Wagstaff Jr Center for Education

Congruences and exponential sums with the sum of aliquot divisors function

arxiv:math/ v2 [math.nt] 21 Oct 2004

Congruences and Exponential Sums with the Euler Function

On Character Sums of Binary Quadratic Forms 1 2. Mei-Chu Chang 3. Abstract. We establish character sum bounds of the form.

Math 4400/6400 Homework #8 solutions. 1. Let P be an odd integer (not necessarily prime). Show that modulo 2,

Ernie Croot 1. Department of Mathematics, Georgia Institute of Technology, Atlanta, GA Abstract

MATH 361: NUMBER THEORY EIGHTH LECTURE

Research Article New Mixed Exponential Sums and Their Application

BOUNDS FOR THE SIZE OF SETS WITH THE PROPERTY D(n) Andrej Dujella University of Zagreb, Croatia

x 2 a mod m. has a solution. Theorem 13.2 (Euler s Criterion). Let p be an odd prime. The congruence x 2 1 mod p,

HENSEL S LEMMA KEITH CONRAD

By Evan Chen OTIS, Internal Use

Research Article A New Sum Analogous to Gauss Sums and Its Fourth Power Mean

On Erdős and Sárközy s sequences with Property P

The Hasse Minkowski Theorem Lee Dicker University of Minnesota, REU Summer 2001

THE LEAST PRIME QUADRATIC NONRESIDUE IN A PRESCRIBED RESIDUE CLASS MOD 4

ANALYTIC NUMBER THEORY AND DIRICHLET S THEOREM

The inverse Goldbach problem

Exponential and character sums with Mersenne numbers

University of Bristol - Explore Bristol Research. Peer reviewed version. Link to published version (if available): 10.

Representing Integers as the Sum of Two Squares in the Ring Z n

Prime Divisors of Palindromes

#A8 INTEGERS 12 (2012) PARTITION OF AN INTEGER INTO DISTINCT BOUNDED PARTS, IDENTITIES AND BOUNDS

LARGE GAPS BETWEEN CONSECUTIVE PRIME NUMBERS CONTAINING SQUARE-FREE NUMBERS AND PERFECT POWERS OF PRIME NUMBERS

Congruences involving product of intervals and sets with small multiplicative doubling modulo a prime

On the Fractional Parts of a n /n

On the Diophantine Equation x 2 = 4q n 4q m + 9

#A64 INTEGERS 18 (2018) APPLYING MODULAR ARITHMETIC TO DIOPHANTINE EQUATIONS

A CONCRETE EXAMPLE OF PRIME BEHAVIOR IN QUADRATIC FIELDS. 1. Abstract

The sum of digits function in finite fields

Elementary Analysis in Q p

MATH342 Practice Exam

We collect some results that might be covered in a first course in algebraic number theory.

Verifying Two Conjectures on Generalized Elite Primes

Introduction to Arithmetic Geometry Fall 2013 Lecture #10 10/8/2013

MATH 3240Q Introduction to Number Theory Homework 7

#A6 INTEGERS 15A (2015) ON REDUCIBLE AND PRIMITIVE SUBSETS OF F P, I. Katalin Gyarmati 1.

ON FREIMAN S 2.4-THEOREM

ON THE DISTRIBUTION OF THE PARTIAL SUM OF EULER S TOTIENT FUNCTION IN RESIDUE CLASSES

March 4, :21 WSPC/INSTRUCTION FILE FLSpaper2011

2 Asymptotic density and Dirichlet density

HOMEWORK # 4 MARIA SIMBIRSKY SANDY ROGERS MATTHEW WELSH

Small Zeros of Quadratic Forms Mod P m

2 Asymptotic density and Dirichlet density

Solvability and Number of Roots of Bi-Quadratic Equations over p adic Fields

DIRICHLET S THEOREM ABOUT PRIMES IN ARITHMETIC PROGRESSIONS. Contents. 1. Dirichlet s theorem on arithmetic progressions

Jacobi symbols and application to primality

HASSE INVARIANTS FOR THE CLAUSEN ELLIPTIC CURVES

MA3H1 TOPICS IN NUMBER THEORY PART III

MATH 361: NUMBER THEORY ELEVENTH LECTURE

arxiv: v5 [math.nt] 22 Aug 2013

The Fibonacci Quarterly 44(2006), no.2, PRIMALITY TESTS FOR NUMBERS OF THE FORM k 2 m ± 1. Zhi-Hong Sun

Florian Luca Instituto de Matemáticas, Universidad Nacional Autonoma de México, C.P , Morelia, Michoacán, México

CONGRUENCES CONCERNING LUCAS SEQUENCES ZHI-HONG SUN

YOUNESS LAMZOURI H 2. The purpose of this note is to improve the error term in this asymptotic formula. H 2 (log log H) 3 ζ(3) H2 + O

On the irreducibility of a polynomial associated with the Strong Factorial Conjecture

On the Rank of the Elliptic Curve y 2 = x(x p)(x 2)

1. INTRODUCTION. Fn 2 = F j F j+1 (1.1)

RECIPROCITY LAWS JEREMY BOOHER

DECIMATIONS OF L-SEQUENCES AND PERMUTATIONS OF EVEN RESIDUES MOD P

MATH 2710: NOTES FOR ANALYSIS

QUADRATIC RECIPROCITY

#A45 INTEGERS 12 (2012) SUPERCONGRUENCES FOR A TRUNCATED HYPERGEOMETRIC SERIES

t s (p). An Introduction

arxiv: v2 [math.nt] 9 Oct 2018

Products of Factorials Modulo p

PETER J. GRABNER AND ARNOLD KNOPFMACHER

JARED DUKER LICHTMAN AND CARL POMERANCE

QUADRATIC RESIDUES AND DIFFERENCE SETS

Applicable Analysis and Discrete Mathematics available online at HENSEL CODES OF SQUARE ROOTS OF P-ADIC NUMBERS

A LLT-like test for proving the primality of Fermat numbers.

Congruences modulo 3 for two interesting partitions arising from two theta function identities

Arithmetic properties of the Ramanujan function

The Lang-Trotter Conjecture on Average

Various Proofs for the Decrease Monotonicity of the Schatten s Power Norm, Various Families of R n Norms and Some Open Problems

JEAN-MARIE DE KONINCK AND IMRE KÁTAI

Primes - Problem Sheet 5 - Solutions

PARTITIONS AND (2k + 1) CORES. 1. Introduction

QUADRATIC RECIPROCITY

arxiv: v4 [math.nt] 11 Oct 2017

(Workshop on Harmonic Analysis on symmetric spaces I.S.I. Bangalore : 9th July 2004) B.Sury

arxiv: v1 [math.nt] 4 Nov 2015

Algebraic number theory LTCC Solutions to Problem Sheet 2

MAS 4203 Number Theory. M. Yotov

ON THE LEAST QUADRATIC NON-RESIDUE. 1. Introduction

Math 104B: Number Theory II (Winter 2012)

Jonathan Sondow 209 West 97th Street, New York, New York

AN IMPROVED BABY-STEP-GIANT-STEP METHOD FOR CERTAIN ELLIPTIC CURVES. 1. Introduction

Character sums with Beatty sequences on Burgess-type intervals

Transcription:

TRANSACTIONS OF THE AMERICAN MATHEMATICAL SOCIETY Volume 356, Number 12, Pages 5089 5102 S 0002-99470403612-8 Article electronically ublished on June 29, 2004 CHARACTER SUMS AND CONGRUENCES WITH n! MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI Abstract. We estimate character sums with n!, on average, and individually. These bounds are used to derive new results about various congruences modulo a rime and obtain new information about the sacings between quadratic nonresidues modulo. In articular, we show that there exists a ositive integer n 1/2+ε such that n! is a rimitive root modulo. We also show that every nonzero congruence class a 0mod can be reresented as a roduct of 7 factorials, a n 1!...n 7!mod, where max{n i i =1,...,7} = O 11/12+ε, and we find the asymtotic formula for the number of such reresentations. Finally, we show that roducts of 4 factorials n 1!n 2!n 3!n 4!, with max{n 1,n 2,n 3,n 4 } = O 6/7+ε reresent almost all residue classes modulo, and that roducts of 3 factorials n 1!n 2!n 3!with max{n 1,n 2,n 3 } = O 5/6+ε are uniformly distributed modulo. 1. Introduction Throughout this aer, is an odd rime. Very little seems to be known about the distribution of n! modulo. In F11 in [7], it is conjectured that about /e of the residue classes a mod are missed by the sequence n!. If this were so, the sequence n! modulo should assume about 1 1/e distinct values. Some results in this sirit aear in [2]. The above conjecture immediately imlies that every residue class a modulo can be reresented as a roduct of at most two factorials. Unconditionally, it is easy to see that three factorials suffice. Indeed, 0! mod, and, as it has been remarked in [5], equation 5 see also [2], the Wilson theorem imlies that 1 b! 1 b! 1 b+1 mod holds for any b {1,..., 1}. Therefore, if a {1,..., 1}, thenwithb a 1 mod, we have 2 a 1! r b b 1! 1 b! mod, where r b {0, 1} is such that r b b + 1 mod 2. However, the above argument does not aly to roving the existence of reresentations involving factorials of integers of restricted size, neither can it be used for estimation of the number of reresentations. In this aer, we first estimate character sums with n! on the average, and individually. We use these estimates to show that for every ε and sufficiently large, there exists a value of n with n = O 1/2+ε andsuchthatn! is a rimitive root modulo. Received by the editors Setember 29, 2003. 2000 Mathematics Subject Classification. Primary 11A07, 11B65, 11L40. 5089 c 2004 American Mathematical Society

5090 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI We aly these estimates to rove that every residue class a 0mod canbe reresented as a roduct of 7 factorials, a n 1!...n 7!mod withmax{n i i = 1,...,7} 11/12+ε. If we only want that most of the residue classes modulo be reresented as a roduct of factorials in the same range as above and even a slightly better one, then we show that four factorials suffice. Moreover, our results imly that for every ε>0and sufficiently large, every residue class a 0mod can be reresented as a roduct of l = ε 1 + 5 factorials, a n 1!...n l!mod, where max{n i i = 1,...,l} 1/2+ε. We also show that roducts of three factorials n 1!n 2!n 3!, with max{n 1,n 2,n 3 } = O 5/6+ε, are uniformly distributed modulo. Our basic tools are the Weil bound for character sums see [12, 13, 18] and the Lagrange theorem bounding the number of zeros of a nonzero olynomial over a field. Some of the results of this aer have found alications to the study of arithmetic roertiesof exressionsof the formn!+fn, where fnisaolynomialwith integer coefficients see [14], or a linearly recurrent sequence of integers see [15]. In articular, an imrovement of a result of Erdős and Stewart [5], obtained in [14], is based on these results. Throughout the aer the imlied constants in symbols O and mayoccasionally, where obvious, deend on integer arameters l and d and a small real arameter ε>0, and are absolute otherwise we recall that A B is equivalent to A = OB. 2. Character sums Let F be a finite field of elements. We always assume that F is reresented by the elements of the set {0, 1,..., 1}. Let X denote the set of multilicative characters of the multilicative grou F and let X = X\{χ 0 } be the set of nonrincial characters. We also define ez =ex2πiz/, whichisanadditivecharacteroff. It is useful to recall the identities { 0, if u 1 mod, χu = 1, if u 1 mod, and 1 eau = a=0 { 0, if u 0 mod,, if u 0 mod, which we will reeatedly use, in articular to relate the number of solutions of various congruences and character sums. Given χ X,aolynomialf F [X],andanelementa F,weconsider character sums T χ, f, H, N = χ n! efn

CHARACTER SUMS AND CONGRUENCES WITH n! 5091 wherewesimlywritet χ, H, N iff is identical to zero, and Sa, H, N = e an!. We obtain a nontrivial uer bound for individual sums T χ, f, H, N, and also nontrivial uer bounds for the moments of T χ, f, H, N and Sa, H, N. Theorem 1. Let H and N be integers with 0 H<H+ N<. Then for any fixed integer d 0, the following bound holds: max max T χ, f, H, N N 3/4 1/8 log 1/4. deg f=d Proof. For any integer k 0wehave T χ, f, H, N = Therefore, for any integer K 0, χ n + k! efn + k + Ok. 3 T χ, f, H, N = 1 K W + OK, where W = = = K 1 k=0 k=1 χ n + k! efn + k K k χ n! n + i efn + k K 1 χ n! χ k=0 k n + i efn + k. Alying the Cauchy inequality, we derive K 1 W 2 k N χ n + i efn + k where = N K 1 k=0 k,m=0 Ψ k,m X = χ Ψk,m n efn + k fn + m, k m X + i X + j 1 and hereafter means that the oles of the corresonding rational function are excluded from the summation we also recall that z 2 = zz for any comlex number z, andthatχa =χa 1 holds for every integer a 0mod whereχ is the conjugate character of χ. Clearly, if K < then, unless k = m, the rational function Ψ k,m X has at least one single root or ole, and thus is not a ower of any other rational function modulo. j=1 2

5092 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI For the OK choices of 0 k = m K 1, we estimate the sum over n trivially as N. For the other OK 2 choices of 0 k, m K 1, using the Weil bound, given in Examle 12 of Aendix 5 of [18] see also Theorem 3 of Chater 6 in [12], or Theorem 5.41 and the comments to Chater 5 of [13], we see that, because χ X, then, for any a F,wehave 1 χ Ψk,m n efn + k fn + m+an =OK 1/2. n=0 Therefore, by the standard reduction of incomlete sums to comlete ones see [1], we deduce χ Ψk,m n efn + k fn + m = OK 1/2 log. Putting everything together, we get W 2 N KN + K 3 1/2 log. Therefore, by 3, we derive T χ, f, H, N NK 1/2 + K 1/2 N 1/2 1/4 log 1/2 + K. Taking K = N 1/2 1/4 log 1/2, we finish the roof. It is clear that for any ε>0thereexistssomeδ>0such that if N 1/2+ε, then T χ, f, H, N N δ, rovided that is large enough. Clearly, Theorem 1 immediately imlies that among the values of n!, where n = H +1,...,H + N, therearen/2+o N 3/4 1/8 log 1/4 quadratic residues and nonresidues. Remarking that each change in the value of the Legendre symbol n!/ corresonds to a quadratic nonresidue n we can derive a certain result about the distribution of sacings between quadratic nonresidues modulo n which does not seem to follow from any of the reviously known results; see [11]. Let n j be the jth quadratic nonresidue modulo and let d j = n j n j 1,the jth sacing, j =1,..., 1/2,whereweutn 0 =0. Corollary 2. Let J be an integer with 1/2 log J 1/2. following bound holds: J 1 j d j J 3/4 1/8 log 1/4. Proof. We have j=1 J 1 j 1 d j = j=1 From the Polya Vinogradov bound 4 max max k 0 h k 1 c=h+1 n J 1 n=0 n!. χc 1/2 log Then the

CHARACTER SUMS AND CONGRUENCES WITH n! 5093 we see that n J =2J +O 1/2 log J and by Theorem 1 we derive the result. Obviously J d j = n J =2J + O 1/2 log, j=1 which demonstrates that for every J 1/2+ε the odd and even sacings d j, j = 1,...,J, are of aroximately the same total length. We now denote by QH, N thenumberofn = H +1,...,H + N such that n! is a rimitive root modulo. Corollary 3. Let H and N be integers with 0 H<H+ N<. Then, for any fixed ε>0, the following bound holds: ϕ 1 QH, N =N + O N 3/4 1/8+ε. 1 Theorem 4. Let H and N be integers with 0 H<H+ N<. Then for any fixed integer d 0, the following bound holds: max deg f=d T χ, f, H, N 2 N 3/2. Proof. Arguing as in the roof of Theorem 1, and alying the Hölder inequality to 3, we derive that for any K T χ, f, H, N 2 where K 2 N K 1 k,m=0 Ψ km X = χ Ψk,m n e fn + k fn + m + K 2, k m X + i X + j 1 and as before means that the oles of the corresonding rational function are excluded from the summation. Therefore, T χ, f, H, N 2 K 2 N K 1 j=1 k,m=0 χ Ψ k,m n + K 2. The sum over χ vanishes, unless 5 Ψ k,m n 1 mod, in which case it is equal to 1. For K airs k, m withk = m then there are N ossible solutions to 5; for other OK 2 airs there are at most K solutions to 5. Thus T χ, f, H, N 2 K 2 N K 3 + KN + K 2 = NK + N 2 K 1 + K 2. Taking K = N 1/2, we finish the roof.

5094 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI Theorem 5. Let H and N be integers with 0 H < H + N <. following bound holds: 1 Sa, H, N 2 N 3/2. a=0 Proof. Arguing as in the roof of Theorem 1, we derive where 1 Sa, H, N 2 K 2 N a=0 Φ k,m X = K 1 k,m=0 a=0 k X + i 1 e an!φ k,m n + K 2, n X + j. j=1 Then the The sum over a vanishes, unless 6 n!φ k,m n 0 mod, in which case it is equal to. As before, we see that Φ k,m X is a nonconstant olynomial of degree OK, unless k = m. Because n! 0mod for0 H<n H + N<,wederive 1 Sa, H, N 2 NK + N 2 K 1 + K 2. a=0 Taking K = N 1/2 and remarking that with this value of K the last term never dominates, we finish the roof. 3. Sums and roducts of factorials For integer l 1andH and N with 0 H<H+ N < let us denote by I l H, N andj l H, N the number of solutions to the congruences l 2l n i! n i! mod, H +1 n 1,...,n 2l H + N, and l n i! i=l+1 2l i=l+1 n i! mod, H +1 n 1,...,n 2l H + N, resectively. From the roerties of multilicative and additive characters we immediately conclude that 7 1 1 T χ, f, H, N 2l 1 T χ, H, N 2l = I l H, N 1 and 1 1 8 Sa, H, N 2l = J l H, N. a=0 The same arguments as in the roof of Theorem 5 lead to the bound J l H, N N 2l 1+1/l+1. We now show that for I l H, N one can derive a more recise estimate.

CHARACTER SUMS AND CONGRUENCES WITH n! 5095 Theorem 6. Let H and N be integers with 0 H<H+ N<. Then for any fixed integer l 1, the following bound holds: I l H, N N 2l 1+2 l. Proof. We rove this bound by induction. If l = 1, then Theorem 4, taken with fx = 0, together with 7, immediately imly the desired bound I 1 H, N N 3/2 and J 1 H, N N 3/2. Now assume that l 2andthatI l 1 H, N N 2l 3+2 l+1. We fix some K<Nandnotethat by the Cauchy inequality we have 2 2 K χn! = χn! k=1 H+k 1N/K<m H+kN/K 2 K K χn!. k=1 H+k 1N/K<m H+kN/K Therefore 2 K K 2l 2 I l H, N = 1 χn! χn! k=1 H+k 1N/K<m H+kN/K = KĨlK, H, N, where ĨlK, H, N is the number of solutions to the congruence l 1 2l 2 m 1! n i! m 2! n i! mod i=l with H +1 n 1,...,n 2l 2 H + N and H +k 1N/K < m 1,m 2 H + kn/k for some k =1,...,K. For each of N airs m 1,m 2 withm 1 = m 2,thereare exactly I l 1 H, N solutions. Also we see that if n 1,...,n 2l 2 are given, then for each fixed value of r = m 1 m 2, there are no more than r solutions in m 1,m 2 because at least one of m 1,m 2 satisfies a nontrivial olynomial congruence of degree r. Certainly r = ON/H. Putting everything together and using the induction assumtion we obtain Ĩ l K, H, N NI l 1 H, N+N/K 2 N 2l 2 = N 2l 2+2 l+1 + N 2l K 2. Therefore I l H, N KN 2l 2+2 l+1 + N 2l K 1. Choosing K = N 1 2 l,we obtain the first bound. We now show that, for N 1/2+ε the above bound on I l H, N, combined with Theorem 1, roduces an asymtotic formula for I l H, N. In articular for H =0, N = 1, this asymtotic formula is nontrivial for l 4. Theorem 7. Let H and N be integers with 0 H<H+ N<. Then for any fixed integers l r 1, the following bound holds: I l H, N = N 2l 1 + O N 3l/2+r/2 1+2 r l r/4 log l r/2.

5096 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI Proof. Similar to [8], we have I l H, N = 1 1 = N 2l 1 + 1 1 χn! 2l = N 2l 1 + O 1 1 max χn! 2l χn! 2l 2r 2r χn! note that in the last sum we bring back the term corresonding to χ = χ 0. The result follows from 7 and Theorems 1 and 6. In articular, using Theorem 7 with r =1weobtain I 4 0, 1 = 7 1+O 1/4 log 3/2. We now denote by F l a, H, N the number of solutions to the congruence l n i! a mod, H +1 n 1,...,n l H + N, where a F. The same arguments as the ones used in the roof of Theorem 7 imly: Theorem 8. Let H and N be integers with 0 H<H+ N<. Then, for any fixed integers l 2r 1, the following bound holds: max a F F la, H, N N l 1 N 3l/4+r/2 1+2 r l 2r/8 log l 2r/4. In articular, using Theorem 8 with r =1weobtain F 7 a, 0, 1 = 6 1+O 1/8 log 5/4, and for any ε>0, using Theorem 8 with r =2weobtain F 7 a, H, N = N 7 1 + o1, for N 11/12+ε, for all a F. Let V l H, N bethenumberofa F for which F la, H, N > 0, that is, { l } V l H, N =# n i!mod, H +1 n 1,...,n l H + N. Theorem 9. Let H and N be integers with 0 H<H+ N<. Then for any fixed integers l r 1, the following bound holds: V l H, N = + O N l/2+r/2 1+2 r l r+8/4 log l r/2.

CHARACTER SUMS AND CONGRUENCES WITH n! 5097 Proof. We may assume that l 2; otherwise there is nothing to rove. Let { } l E = h F h n i!mod, H +1 n 1,...,n l H + N. Then, 1 1 n 1,...,n l =H+1 h E χn 1!...n l!h 1 =0. Searating the term corresonding to χ 0 and, for χ X, alying Theorem 1 to the sums over n 1,...,n l r,weobtain #EN l l r 1 1 N 3/4 1/8 log 1/4 r χh χn!. 1 h E As before, we now extend summation over all characters χ X and by the Cauchy inequality, we derive from 7 and Theorem 6 r χh χn! 2 2 χh 1 2r χn! h E = 1I r H, N#E 1 2 N 2r 1+2 r #E. Therefore, N l #E l r 1 N 3/4 1/8 log 1/4 #EN 2r 1+2 r 1/2, which finishes the roof. In articular, using Theorem 9 with r =2weseethatforN > 6/7+ε, we have that only o residue classes modulo cannot be reresented as n 1!n 2!n 3!n 4! mod withh +1 n 1,n 2,n 3,n 4 H + N. We recall that the discreancy D of a sequence of M oints γ j M j=1 of the unit interval [0, 1] is defined as D =su I AI M h E I, where the suremum is taken over the interval I =[α, β] [0, 1] of length I = β α and AI is the number of oints of this set which belong to I see [4, 10]. For an integer a with gcda, = 1, we denote by D l a, H, N the discreancy of the sequence of fractional arts { } a l n i!, H +1 n 1,...,n l H + N. Obviously, 9 D l a, H, N = max 0 h k 1 1 k N l c=h+1 F l a 1 c, H, N k h + O 1, thus Theorem 8 can be used to estimate D l a, H, N. However, we show that the Polya Vinogradov bound 4 leads to stronger results.

5098 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI Theorem 10. Let H and N be integers with 0 H<H+ N<. Then for any fixed integers l 2r 1, the following bound holds: max D la, H, N N l/4+r/2 1+2 r l 2r+4/8 log l 2r+4/4. 1 a 1 Proof. We have k c=h+1 F l a 1 c, H, N k h N l = 1 1 1 = χa 1 Thus, alying the bound 4, we deduce k F l a 1 c, H, N k h N l c=h+1 max χn! k c=h+1 n 1,...,n l =H+1 k a=h+1 l 2r χc χ χn! ac 1 2r l n i! χ n! l. and the result follows from 7 and Theorems 1 and 6. In articular, using Theorem 10 with r = 1 we obtain that max D 3a, 0, 1 = O 1/8 log 5/4, 1 a 1 and also that for any ε>0, max D 30, 1 = o1, for N 5/6+ε. 1 a 1 We also note that Theorem 10 imlies that max 1 a 1 1/2 log, l e a n i! N l/4+r/2 1+2 r l 2r+4/8 log l 2r+4/4 for l 2r 1. Let G l a, N be the number of solutions to the congruence: l n i! a mod, in ositive integers n 1,...,n l with l n i = N. It has been shown in [16] that for any ε and sufficiently large, G l a, N > 0 rovided that l ε and N l> 1/2+ε. In [6], the same result has been obtained under a much weaker condition N l> 1/4+ε. Here, concentrate on the value of l and show that it can be taken as l = O1 rovided N> 1/2+ε.

CHARACTER SUMS AND CONGRUENCES WITH n! 5099 Theorem 11. For any fixed integer l 1 and any integer N with 1 N</l, the following bound holds: max a F G la, N 1 N 1 N 3l/4 l+6/8 log l 2/4. 1 l 1 Proof. For a 0mod, we have G l a, N = 1 l χ a 1 n i!, 1 n 1,...,n l 1 n 1+...+n l =N where the sum is taken over all multilicative characters χ modulo. Searating the contribution from the rincial character χ 0,weobtain G la, N 1 N 1 1 1 l 1 1 R, where R = l χa 1 χ n i! n 1,...,n l 1 n 1+...+n l =s = N l 1 χa 1 1 χ n i! ecn 1 +...+ n l N, n 1,...,n l =1 c=0 because if ln <, then the congruence n 1 +... + n l s mod with1 n 1,...,n l N is equivalent to the equation n 1 +...+ n l = s. Therefore, R 1 1 l N χ n! ecn. c=0 n=1 Arguing as in the roof of Theorem 7, the result follows from 7 and Theorems 1 and 6. For examle, for any fixed ε>0and/l > N 1/2+ε,wehave G l a, N = 1 N 1 1 + o1 1 l 1 for every fixed l>ε 1 +4. We remark that one can easily dro the condition N</lin Theorem 11. Let F a, H, N = F 1 a, H, N be the number of solutions of the congruence n! a mod, H +1 n H + N. Theorem 12. Let H and N be integers with 0 H < H + N <. Then the following bound holds: max F a, H, N N 2/3. a F Proof. Let K>0beaarametertobechosenlater.Let A = {H +1 n H + N a n! mod} = A 1 A 2, where A 1 = {n A n m >Kfor all m n, m A} and A 2 = A\A 1.

5100 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI It is clear that #A 1 N/K. Assume now that n A 2. Then there exists a nonzero integer k with k K and such that n! n + k! mod. For each k, the above relation leads to a olynomial congruence in n of degree k and therefore it has at most k K solutions n. Summing u over all values of k with k K, we get that #A 2 K 2.Thus, F a, H, N =#A =#A 1 +#A 2 N K + K2, and choosing K = N 1/3 we get the desired inequality. We have seen that the Wilson theorem immediately imlies the inequality V 2 0, 1 1/2. We now show that this bound can be slightly imroved. Theorem 13. The following bound holds: V 2 0, 1 5 8 + O1/2 log 2. Proof. By 2, we see that if a b 1 mod, 1 b 1, is odd, then a V 2 0, 1. By 1, we see that if a c 1 c +1 1 mod withsomeevenc =2u, 1 c 3, then a V 2 0, 1 too. Thus each such c that corresonds to an even b =2v in the above reresentation, contributes one new element to V 2 0, 1. It is also clear that no more than two distinct values of c can contribute the same element. Therefore, V 2 0, 1 1/2+W/2, where W is the number of solutions of the congruence 2u2u +1 2v mod, 0 u, v 3/2. The Weil bound yields W = /4 +O 1/2 log 2 see [1], which concludes the roof. We remark that Theorem 13 immediately imlies that for every integer a there exists a reresentation a n 1!n 2!+n 3!n 4!mod with some ositive integers n 1,n 2,n 3,n 4. 4. Concluding remarks Most of our results hold in more general settings. For examle, let m 1be any fixed ositive integer and ut m T m, χ, f, H, N = χ n + ν 1! efn. Then Theorem 1 holds with T χ, f, H, N relaced by T m, χ, f, H, N. In articular, if we write Qm, H, N forthenumberofn = H +1,...,H + N such that n!,...,n + m 1! are all rimitive roots modulo, then the estimate m ϕ 1 Qm, H, N =N + O N 3/4 1/8+ε 1 holds for any ε>0. ν=1

CHARACTER SUMS AND CONGRUENCES WITH n! 5101 Let Q be the set of all distinct rime divisors of 1. For a set R Q,we denote by T R,H,Nthenumberofn = H +1,...,H + N such that for every q Q, n! isaqth ower residue modulo if and only if q R. Then the estimate T R,H,N=N q R q 1 q q Q\R 1 q + O N 3/4 1/8+ε holds for any ε>0. Techniques of the resent aer aly also to the sequences 2n = 2n!, 2n +1!!=1 3... 2n +1, n n! 2 and many others, as well as their combinations. Also, with some minor adjustments, our methods can be used to obtain similar, albeit somewhat weaker results for comosite moduli. In this setu, our basic tools such as the Weil bound and the Lagrange theorem, have to be relaced with their analogues in residue rings modulo a comosite number. See, for examle, [3] for bounds of character sums, and [9] for bounds on the number of small solutions of olynomial congruences. While the results of the resent aer reresent some rogress towards better understanding of the behaviour of n! modulo, there are several challenging questions that deserve further investigation. For examle, our Theorem 12 gives a nontrivial uer bound on F a, H, N, but we conjecture that this result is far from being shar. We do not have any nontrivial individual uer bounds for Sa, H, N. Certainly, studying V 1 H, N is of rimal interest. Trivially, we have V 1 H, N N 1 1/2 to see this it is enough to recall that n = n!/n 1!, but we have not been able to obtain any better lower bound. In the oosite direction, answering aquestionoferdős, Rokowska and Schinzel [17] have shown that if the residues of 2!, 3!,..., 1! modulo are all distinct, then the missing residue must be that of 1/2!, that 5 mod 8, and that no such exists in the interval [7, 1000], but it does not seem to be even known that there can be only finitely many such, or, equivalently, that V 1 0, 1 = 2 can haen only for finitely many values of the rime. It is very temting to try to generalize the roof of Theorem 13 and consider longer roducts cc +1...c + m. This may lead to an imrovement of the constant 5/8 of Theorem 13. However, to imlement this strategy one has to study in detail image sets of such olynomials and their overlas, which may involve rather comlicated machinery. Acknowledgements The authors would like to thank Vsevolod Lev for several useful comments. During the rearation of this aer, F. L. was suorted in art by grants SEP- CONACYT 37259-E and 37260-E, and I. S. was suorted in art by ARC grant DP0211459. References [1] J. H. H. Chalk, Polynomial congruences over incomlete residue systems modulo k, Proc. Kon. Ned. Acad. Wetensch., A92 1989, 49 62. MR 90e:11050 [2] C. Cobeli, M. Vâjâitu and A. Zaharescu, The sequence n! mod, J. Ramanujan Math. Soc., 15 2000, 135 154. MR 2001g:11153

5102 MOUBARIZ Z. GARAEV, FLORIAN LUCA, AND IGOR E. SHPARLINSKI [3] T. Cochrane and Z. Y. Zheng, A survey on ure and mixed exonential sums modulo rime owers, Proc. Illinois Millennial Conf. on Number Theory, Vol.1, A.K. Peters, Natick, MA, 2002,. 271 300. MR 2004b:11120 [4] M. Drmota and R. Tichy, Sequences, discreancies and alications, Sringer-Verlag, Berlin, 1997. MR 98j:11057 [5] P. Erdős and C. Stewart, On the greatest and least rime factors of n!+1, J. London Math. Soc., 13 1976, 513 519. MR 53:13093 [6] M. Z. Garaev and F. Luca, On a theorem of A. Sárközy and alications, Prerint, 2003. [7] R. K. Guy, Unsolved roblems in number theory, Sringer-Verlag, New York, 1994. MR 96e:11002 [8] A. A. Karatsuba, The distribution of roducts of shifted rime numbers in arithmetic rogressions, Dokl. Akad. Nauk SSSR, 192 1970, 724 727; English transl., Soviet Math. Dokl., 11 1970, 701 711. MR 42:4506 [9] S. V. Konyagin and T. Steger, Polynomial congruences, Matem. Zametki, 55 1994, no. 1, 73 79; English transl., Math. Notes, 55 1994, 596 600. MR 96e:11043 [10] L. Kuiers and H. Niederreiter, Uniform distribution of sequences, John Wiley, NY, 1974. MR 54:7415 [11] P. Kurlberg and Z. Rudnick, The distribution of sacings between quadratic residues, Duke Math. J., 100 1999, 211 242. MR 2000k:11109 [12] W.-C. W. Li, Number theory with alications, World Scientific, Singaore, 1996. MR 98b:11001 [13] R. Lidl and H. Niederreiter, Finite fields, Cambridge University Press, Cambridge, 1997. MR 97i:11115 [14] F. Luca and I. E. Sharlinski, Prime divisors of shifted factorials, Prerint, 2003. [15] F. Luca and I. E. Sharlinski, On the largest rime factor of n!+2 n 1, Prerint, 2003. [16] F. Luca and P. Stănică, Products of factorials modulo, Colloq. Math., 96 2003, 191 205. [17] B. Rokowska, A. Schinzel, Sur une robléme de M. Erdős, Elem. Math., 15 1960, 84 85. MR 22:7970 [18] A. Weil, Basic number theory, Sringer-Verlag, New York, 1974. MR 55:302 Instituto de Matemáticas, Universidad Nacional Autónoma de México, C.P. 58180, Morelia, Michoacán, México E-mail address: garaev@matmor.unam.mx Instituto de Matemáticas, Universidad Nacional Autónoma de México, C.P. 58180, Morelia, Michoacán, México E-mail address: fluca@matmor.unam.mx Deartment of Comuting, Macquarie University, Sydney, New South Wales 2109, Australia E-mail address: igor@ics.mq.edu.au