arXiv:1108.2579v7 [math.NT] 2 May 2016 iteterm the theorem, little base as fisnmru plctosi ubrter n computer and theory [ number example, in for applications see, numerous science; its of cause where hnw call we then ifrc ubr efc olna function. nonlinear perfect number, Wieferich a ae ntevepito rtmtc oeaihei propertie arithmetic More [ Lerch [ arithmetic. in by of investigated 1905 viewpoint were the in on published based was was quotient Fermat of study if Moreover, sn ue’ hoe.Let the theorem. Euler’s using eycrflsuyo ue quotients. Euler of study careful very a H RTMTCO AMCALQUOTIENTS CARMICHAEL OF ARITHMETIC THE hsqoin a enetnieysuidfo aiu set be aspects various from studied extensively been has quotient This Let e od n phrases. and words Key n[ In 2010 ue quotient Euler a 4 . p ϕ ahmtc ujc Classification. Subject ial,w ikCrihe utet opretnnierfunc- nonlinear perfect to quotients Carmichael tions. on. link so we and fr Finally, numbers, derived sequences Carmichael-Wieferich properties, quotients, arithmetic Carmichael basic as such gated, ue nlgu oFra utet,b sn amcalfunc- Carmichael using by quotients, Fermat tion to analogous duced Abstract. ,teatosgnrlzdtedfiiino emtqoin by quotient Fermat of definition the generalized authors the ], eapieand prime a be sElrsttetfnto.Mroe,if Moreover, function. totient Euler’s is λ ( Q m m p .Vrospoete fteenwqoinsaeinvesti- are quotients new these of properties Various ). ( a a ifrc number Wieferich ) amcalqoinsfra integer an for quotients Carmichael emtquotient Fermat ≡ of 3 (mod 0 m ]. amcalfnto,Crihe utet Carmichael- quotient, Carmichael function, Carmichael ihbase with Q a 1. Q m 7 nitgrntdvsbeby divisible not integer an p m , Introduction ( ( p a a 8 ,te ecall we then ), = ) I SHA MIN = ) ≥ , 9 and 2 , 1 a a a of 11 ϕ p ihbase with sdfie sfollows as defined is − ( p , m 12,1B0 11A07. 11B50, 11A25, 1 m p 16 ihbase with ) − a − , erltvl rm integers, prime relatively be 1 1 17 . , p .Afis comprehensive first A ]. a a hyas undertook also They . ifrc prime Wieferich m Q a m sdfie sfollows as defined is ≥ ( a r intro- are 2 ) p ≡ yFermat’s by , (mod 0 12 om ,which ], with m ), s - 2 MIN SHA

In fact, there are some other generalizations of Fermat quotients, see [1, 18, 19]. Especially, in [1] the author introduced a quotient like (ae − 1)/m, where gcd(a, m) = 1 and e is the multiplicative order of a modulo m. In this paper, we introduce a different generalization of Fermat quo- tient by using Carmichael function and study its arithmetic properties. For a positive integer m, the Carmichael function λ(m) is defined to be the exponent of the multiplicative group (Z/mZ)∗. More explicitly, λ(1) = 1; for a prime power pr we define r 1 r p − (p − 1) if p ≥ 3 or r ≤ 2, λ(p )= r 2  2 − if p = 2 and r ≥ 3; and r1 r2 rk λ(m) = lcm(λ(p1 ),λ(p2 ), ··· ,λ(pk )), where, as usual, “lcm” means the , and m = r1 r2 rk p1 p2 ··· pk is the prime factorization of m. For every positive integer m, we have λ(m)|ϕ(m), and λ(m)= ϕ(m) if and only if m ∈{1, 2, 4,pk, 2pk}, where p is an odd prime and k ≥ 1. In addition, if m|n, we have λ(m)|λ(n). Definition 1.1. Let m ≥ 2 and a be relatively prime integers. The quotient aλ(m) − 1 C (a)= m m is called the Carmichael quotient of m with base a. Moreover, if Cm(a) ≡ 0 (mod m), we call m a Carmichael-Wieferich number with base a. We want to indicate that the term “Carmichael quotient” was intro- duced in [2] to denote a different quotient, and we think that there is no much danger of confusion. We extend many known results about Fermat quotients or Euler quo- tients to Carmichael quotients by using the same techniques, such as basic arithmetic properties with special emphasis on congruences, the least periods of sequences derived from Carmichael quotient, Carmichael- Wieferich numbers. Finally, we link Carmichael quotients to perfect nonlinear functions. 2. Arithmetic of Carmichael Quotients In what follows, we fix m ≥ 2 an integer unless stated otherwise. In this section, we study some basic arithmetic properties of Carmichael quotients and extend some results about Fermat quotients or Euler quotients in [4, 12, 13]. See [4] for historical literatures. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 3

For any integer a with gcd(a, m) = 1, we have Cm(a)|Qm(a). In par- ticular, Cm(a)= Qm(a) when m is an odd prime power. Furthermore, it is straightforward to prove that they have the following relation. Proposition 2.1. For any integer a with gcd(a, m)=1, we have ϕ(m) Q (a) ≡ · C (a) (mod m). m λ(m) m Proof. Since λ(m)|ϕ(m), we derive (aλ(m))ϕ(m)/λ(m) − 1 Q (a)= m m λ(m) λ(m) λ(m) ϕ(m)/λ(m) 1 (a − 1) 1+ a + ··· +(a ) − = m  ϕ(m) ≡ C (a) (mod m). λ(m) m 

Now we state two fundamental congruences for Carmichael quotients, which are crucial for further study. Proposition 2.2. (1) If a and b are integers with gcd(ab, m)=1, then we have

Cm(ab) ≡ Cm(a)+ Cm(b) (mod m). (2) If a, k are integers with gcd(a, m)=1, and α is a positive integer, then we have

α kλ(m) α 1 α C (a + km ) ≡ C (a)+ m − (mod m ). m m a Proof. (1) We only need to notice that aλ(m)bλ(m) − 1 C (ab)= m m (aλ(m) − 1)(bλ(m) − 1)+(aλ(m) − 1)+(bλ(m) − 1) = . m (2) Using the binomial expansion, it is easy to see that aλ(m) + λ(m)aλ(m) 1kmα − 1 C (a + kmα) ≡ − (mod mα), m m which implies the desired congruence. 

The following two corollaries concern some short sums of Carmichael quotients. 4 MIN SHA

Corollary 2.3. If m ≥ 3, for any integer a with gcd(a, m)=1, we have m 1 − Cm(a + km) ≡ 0 (mod m). Xk=0 Proof. First applying Proposition 2.2 (2) and then noticing that λ(m) is even when m ≥ 3, we obtain

m 1 − λ(m) m(m − 1) C (a + km) ≡ · ≡ 0 (mod m). m a 2 Xk=0 

Corollary 2.4. If m ≥ 3, for any integer a with gcd(a, m)=1, we have m2

Cm(a) ≡ 0 (mod m). Xa=1 gcd(a,m)=1 Proof. Notice that

m2 m m 1 − Cm(a)= Cm(a + km). Xa=1 Xa=1 Xk=0 gcd(a,m)=1 gcd(a,m)=1 Then, the desired result follows from Corollary 2.3.  We want to remark that the results in Corollaries 2.3 and 2.4 are not true when m = 2. The next proposition concerns some relationships between various Cm(a) with fixed base a and different moduli. Proposition 2.5. (1) If gcd(a, mn)=1, then

Cm(a)|nCmn(a). (2) If gcd(a, mn) = gcd(m, n)=1, then λ(n) C (a) ≡ C (a) (mod m). mn n · gcd(λ(m),λ(n)) m (3) Assume that gcd(a, mn) = gcd(m, n)=1, and let X and Y be two integers satisfying m2X + n2Y =1. Then nλ(n) mλ(m) C (a) ≡ YC (a)+ XC (a) (mod mn). mn gcd(λ(m),λ(n)) m gcd(λ(m),λ(n)) n THE ARITHMETIC OF CARMICHAEL QUOTIENTS 5

λ(m)λ(n) Proof. (2) Under the assumption, noticing that λ(mn)= gcd(λ(m),λ(n)) , we have λ(n) λ(m)λ(n) λ(m) λ m ,λ n gcd(λ(m),λ(n)) a gcd( ( ) ( )) 1 a 1 ( ) − Cmn(a)= mn − = mn λ(n)(aλ(m) 1) − ≡ mn gcd(λ(m),λ(n)) (mod m). · (3) It suffices to show that the equality is true for modulo m and modulo n respectively. But this follows directly from (2).  For any integer a with gcd(a, m) = 1, we denote hai as the subgroup of (Z/mZ)∗ generated by a, and we let ordma be the multiplicative order of a modulo m. The following expression is so-called Lerch’s expression [13].

Proposition 2.6. If gcd(a, m)=1 and assume n = ordma, then λ(m) m 1 ar C (a) ≡ (mod m), m n ar m Xr=1 j k r a ∈h i where ⌊x⌋ denotes the greatest integer ≤ x.

Proof. For each 1 ≤ r ≤ m with r ∈ hai, we write ar ≡ cr(mod m), with 1 ≤ cr ≤ m. Notice that when r runs through all elements with 1 ≤ r ≤ m and r ∈ hai, so does cr. Let P denote the product of all such integers cr. If the products and sums below are understood to be taken over all r with 1 ≤ r ≤ m and r ∈hai, we have

λ(m) λ(m) λ(m) λ(m) n λ(m) n n ar λ(m) m ar P n = cr = ar − m = a P n 1 − . Y Y  j m k Y  ar j m k So λ(m) λ(m) n m ar n 1 ar 1= aλ(m) 1 − ≡ aλ(m) 1 − m (mod m2). Y  ar j m k  X ar j m k Then we get mλ(m) m 1 ar aλ(m) − 1 ≡ aλ(m) (mod m2), n ar m Xr=1 j k r a ∈h i which implies the desired congruence.  In the last part of this section, we describe the decomposition of Carmichael quotients in the dependence of the prime factorization of the modulus. Further we investigate Carmichael quotients for prime power moduli. 6 MIN SHA

r1 rk Proposition 2.7. Let m = p1 ··· pk be the prime factorization of m, and let a be an integer with gcd(a, m)=1. For 1 ≤ i ≤ k, let ri ri 2 di = λ(m)/λ(pi ), mi = m/pi and mi′ ∈ Z such that mi mi′ ≡ 1 (mod ri pi ). Then k

Cm(a) ≡ mim′ diC ri (a) (mod m). i pi Xi=1 Proof. It suffices to prove for each 1 ≤ j ≤ k,

k rj Cm(a) ≡ mim′ diC ri (a) (mod p ), i pi j Xi=1 that is rj r Cm(a) ≡ mjmj′ djC j (a) (mod pj ). pj Since we have rj rj λ(pj )dj λ(pj ) a − 1 dj(a − 1) rj r Cm(a)= ≡ ≡ mjmj′ djC j (a) (mod pj ), m m pj the result follows.  Proposition 2.8. Let p be an odd prime and gcd(a, p)=1. For any two integers i and j with 1 ≤ i ≤ j, we have i Cpj (a) ≡ Cpi (a) (mod p ). Besides, for 3 ≤ i ≤ j and gcd(a, 2)=1, we have

i 1 C2j (a) ≡ C2i (a) (mod2 − ).

Proof. Notice that Cpi (a)= Qpi (a) if p is an odd prime. By [4, Propo- sition 4.1], for any integer k ≥ 1, we have

k Cpk+1 (a) ≡ Cpk (a) (mod p ). Then the first formula follows. Since for r ≥ 3, we have

r−2 a2 1 r r r r C2 +1 (a) − C2 (a) ≡ 2 − C2 (a) (mod2 ) r 1 ≡ 0 (mod2 − ), we get the second formula.  The following corollary, about the relation between Carmichael quo- tients and Fermat quotients, can be obtained directly from the above two propositions. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 7

Corollary 2.9. Suppose that p is an odd prime factor of m, and pα λ(m) α is the largest power of p dividing m. Let d1 = λ(pα) , m1 = m/p , and 2 α m1′ ∈ Z such that m1m1′ ≡ 1 (mod p ). Then for any integer a with gcd(a, m)=1, we have

Cm(a) ≡ m1m1′ d1Qp(a) (mod p). 3. Sequences derived from Carmichael quotients In this section, we will define two periodic sequences by Carmichael quotients and determine their least (positive) periods following the method in the proof of [10, Proposition 2.1]. As usual, for a periodic sequence {sn}n∞=1, a positive integer j is called its period if sn+j = sn for any n ≥ 1; if further j is the smallest positive integer endowed with such property, we call j the least period of {sn}. r1 rk Let m = p1 ··· pk be the prime factorization of the integer m (m ≥ ri 2). For each 1 ≤ i ≤ k, put mi = m/pi , and let wi be the integer wi ri ri defined by pi = gcd(λ(m)/λ(pi ),pi ), here note that 0 ≤ wi ≤ ri. Now, we want to define a sequence {an} following the manner in [10]. First, for any integer n and any 1 ≤ i ≤ k, if pi|n, set C ri (n) = 0. pi Then, for every integer n ≥ 1, by Proposition 2.7, an is defined as the unique integer with k mim′ λ(m) i r an ≡ r C i (n) (mod m), 0 ≤ an ≤ m − 1, λ(p i ) pi Xi=1 i 2 ri where mi′ ∈ Z is such that mi mi′ ≡ 1 (mod pi ) for each 1 ≤ i ≤ k. So, if gcd(n, m) = 1, we have an ≡ Cm(n) (mod m). 2 By Proposition 2.2 (2), m is a period of {an}. We denote its least period by T . For each 1 ≤ i ≤ k, let Ti be the least period of the ri sequence {an mod pi }. Obviously, we have

T = lcm(T1, ··· , Tk).

Thus, in order to determine T , it suffices to compute Ti for each 1 ≤ i ≤ k. For every 1 ≤ i ≤ k, we have

λ(m) ri (3.1) an ≡ C ri (n) (mod p ). ri pi i miλ(pi ) ri wi So, Ti equals to the least period of {C ri (n) mod p − }. Here, we pi i ri wi also denote Ti as the least period of the sequence {C ri (n) mod p − } pi i without confusion. In the sequel, we will calculate Ti case by case for any fixed 1 ≤ i ≤ k. 8 MIN SHA

Lemma 3.1. If wi = ri, then Ti =1.

ri wi Proof. Since in this case we have C ri (n) ≡ 0 (mod p − ) for all pi i n ≥ 1. 

ri wi+1 Lemma 3.2. If pi > 2 and wi

Now, it remains to consider the case pi = 2.

Lemma 3.3. If pi =2 and wi =0, then

4 ri =1, Ti =  8 ri =2, ri+2  2 ri ≥ 3 Proof. Notice that for each nwith gcd(n, 2) = 1, by Proposition 2.2 (2) we have

ri 1 ri ri C2ri (n + ℓ · 2 ) ≡ C2ri (n)+ ℓn− λ(2 ) (mod2 ). Then, the result follows easily. 

Lemma 3.4. For r ≥ 3, the least period of the sequence {C2r+1 (n) mod 2r} is 2r+2.

r−2 n2 +1 r r Proof. For r ≥ 3 and gcd(n, 2) = 1, we have C2 +1 (n)= 2 C2 (n). Then using Proposition 2.2 (2), we deduce that r−2 r n2 +1 r r r r r C2 +1 (n + ℓ · 2 ) − C2 +1 (n) = 2 (C2 (n + ℓ · 2 ) − C2 (n)) r−2 n2 +1 1 r 2 r ≡ 2 · ℓn− 2 − (mod2 ), r− which implies the desired result by noticing that n2 2 ≡ 1 (mod 2r) r−2 n2 +1  and then 2 is odd.

ri wi+2 Lemma 3.5. If pi =2 and 3 ≤ ri − wi

− ri wi C2ri (n) ≡ C2ri wi+1 (n) (mod2 − ). Then, the result follows directly from Lemma 3.4.  THE ARITHMETIC OF CARMICHAEL QUOTIENTS 9

ri wi+2 Lemma 3.6. If pi =2, ri ≥ 3 and 1 ≤ ri − wi ≤ 2, then Ti =2 − . Proof. From Proposition 2.8, for gcd(n, 2) = 1, we have 2 C2ri (n) ≡ C23 (n) (mod2 ).

ri wi So, Ti equals to the least period of the sequence {C23 (n) mod2 − }. By Proposition 2.2 (2), we have 3 1 2 C23 (n + ℓ · 2 ) ≡ C23 (n)+2ℓn− (mod2 ), which implies the desired result. In fact, one can also verify this lemma by direct calculations. 

Lemma 3.7. If pi =2, ri =2 and wi =1, then Ti =1. We summarize the above results in the following proposition.

Proposition 3.8. For each 1 ≤ i ≤ k, if pi is an odd prime, then

1 wi = ri, Ti = ri wi+1  pi − wi

1 wi = ri,  4 ri =1,wi =0, T =  8 ri =2,wi =0, i   1 ri =2,wi =1, ri wi+2 2 − ri ≥ 3,wi

bn ≡ Cm(n) (mod m), 0 ≤ bn ≤ m − 1; and we also define

bn =0, if gcd(n, m) =16 .

Since bn also satisfies (3.1) for any integer n with gcd(n, m) = 1, the least period of {bn} equals to that of {an}.

Proposition 3.9. The sequence {bn} has the same least period as {an}. 10 MIN SHA

4. Carmichael-Wieferich Numbers In this section, except for extending some results in [4], we study Carmichael-Wieferich numbers from more aspects, especially Proposi- tion 4.5. First, we want to deduce some basic facts for Carmichael-Wieferich numbers. Proposition 4.1. If m ≥ 3 and 1 ≤ a ≤ m with gcd(a, m)=1, then m cannot be a Carmichael-Wieferich number with bases both a and m−a. Proof. Notice that λ(m) is even when m ≥ 3. By Proposition 2.2 (2), we have λ(m) C (m − a) ≡ C (a) − (mod m). m m a Then, the desired result comes from λ(m) < m. 

Corollary 4.2. If m ≥ 3, define the set Sm = {a :1 ≤ a ≤ m, gcd(a, m)= 1, m is a Carmichael-Wieferich number with base a}. Then |Sm| ≤ ϕ(m)/2. By Proposition 2.2 (2), for any gcd(b, m) = 1, there exists 1 ≤ a ≤ m2 with b ≡ a (mod m2), such that

Cm(b) ≡ Cm(a) (mod m). Hence, if we want to determine with which base m can be a Carmichael- Wieferich number, we only need to consider 1 ≤ a ≤ m2. r1 rk Assume that m has the prime factorization m = p1 ··· pk . In [4, Proposition 4.4] the authors have used the Euler quotient Qm to define a 2 homomorphism from (Z/m Z)∗ to (Z/mZ, +), whose image is dZ/mZ, where (4.1)

k ri ri gcd(pi , 2ϕ(m)/ϕ(pi )) if pi = 2 and ri ≥ 2, d = di and di = ri ri  gcd(pi ,ϕ(m)/ϕ(pi )) otherwise. Yi=1 Here, we can do similar things using the Carmichael quotient and ap- plying the same strategy as in [4]. By Proposition 2.2, the Carmichael quotient Cm(x) induces a homo- morphism 2 φm :(Z/m Z)∗ → (Z/mZ, +), x 7→ Cm(x).

r1 rk Proposition 4.3. Let m = p1 ··· pk be the prime factorization of m ≥ 2. For 1 ≤ i ≤ k, put

ri ri gcd(pi , 2λ(m)/λ(pi )) if pi =2 and ri =2, di′ = ri ri  gcd(pi ,λ(m)/λ(pi )) otherwise. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 11

k Let d′ = i=1 di′ . Then the image of the homomorphism φm is d′Z/mZ. Q Proof. We show the desired result case by case. (I) First we prove the result for the case k = 1, that is m = pr, where p is a prime and r is a positive integer. Suppose that p =2. If r = 2, then Cm(3) = 2, and for any positive integer n we have Cm(2n +1) = n(n + 1), which is even, so the image of φm is 2Z/mZ. On the other hand, if r =1 or r ≥ 3, since C2(3) = 1 and C8(3) = 1, by using Proposition 2.8 we see that Cm(3) is an odd integer, so the image of φm is Z/mZ. Now, assume that p > 2. Note that Cp(p + 1) ≡ −1 (mod p), by Proposition 2.8 we have Cm(p + 1) ≡ −1 (mod p), which implies that p ∤ Cm(p + 1). Thus, there exists a positive integer n such that nCm(p + 1) ≡ 1 (mod m). Then, by Proposition 2.2 (1) we deduce n that Cm((p + 1) ) ≡ 1 (mod m). So, the image of φm is Z/mZ. (II) To complete the proof, we prove the result when k ≥ 2. ri ri For simplicity, denote mi = m/pi and ni = λ(m)/λ(pi ) for each 2 ri 1 ≤ i ≤ k, and then let mi′ be an integer such that mi mi′ ≡ 1 (mod pi ). By Proposition 2.7, we have

k

(4.2) Cm(a) ≡ mim′ niC ri (a) (mod m). i pi Xi=1

ri So, for each 1 ≤ i ≤ k, Cm(a) ≡ mim′ niC ri (a) (mod p ). If pi = 2 i pi i and ri = 2, note that for any odd integer a > 1, C4(a) is even, then we see that d′ | niC ri (a), and thus d′ | Cm(a). Otherwise if pi > 2 or i pi i ri =6 2, then di′ | ni, and so di′ | Cm(a). Hence, we have d′ | Cm(a) for any integer a coprime to m.

Let b = gcd(m, m1m1′ n1,...,mkmk′ nk). Then, there exist integers X1,...,Xk such that

k

(4.3) b ≡ mimi′ niXi (mod m). Xi=1

ri k If we denote bi = gcd(pi , mimi′ ni) for each 1 ≤ i ≤ k, then b = i=1 bi, ri here we remark that bi = gcd(pi , ni). It is easy to see that forQ each 1 ≤ i ≤ k, if pi > 2 or ri =6 2, we have di′ = bi. Further, when pi = 2 and ri = 2, di′ =2bi if 8 ∤ λ(2p1 ...pk), and di′ = bi otherwise. We now have three cases for m:

(i) There exists 1 ≤ j ≤ k such that pj =2,rj = 2 and

8 ∤ λ(2p1 ...pk). 12 MIN SHA

(ii) There exists 1 ≤ j ≤ k such that pj =2,rj = 2 and

8 | λ(2p1 ...pk). (iii) All the other cases.

Clearly, in Cases (ii) and (iii) we have d′ = b, and in Case (i) d′ =2b. According to (I), there exist integers ai with pi ∤ ai for 1 ≤ i ≤ k defined by

2Xi in Case (i),  Xi in Case (iii), r r  i C i (ai) ≡  (mod pi ) pi   Xi in Case (ii) and i =6 j,  0 in Case (ii) and i = j.  By the Chinese Remainder Theorem, we can choose a positive integer 2ri a such that a ≡ ai (mod pi ). So, by Proposition 2.2 (2) we have ri C ri (a) ≡ C ri (ai) (mod p ). Then, combining with (4.3) and the pi pi i ri relation between b and d′, we obtain mim′ niC ri (a) ≡ d′ (mod p ) for i pi i each 1 ≤ i ≤ k in all the three cases. Finally, using (4.2) we have Cm(a) ≡ d′ (mod m), which completes the proof. 

Comparing (4.1) with Proposition 4.3, we have d′ | d. Moreover, by Proposition 2.1 we get ϕ(m) d′Z/mZ = dZ/mZ, λ(m) ϕ(m) which implies that gcd( λ(m) d′, m)= d. In Proposition 4.3, if choosing m = 2r with r ≥ 3, we have d = 2 r1 r2 and d′ = 1; while choosing m = 2 p with r1 ≥ 3 and odd prime p ≡ 3 (mod 4), we have d = 4 and d′ = 1. Hence, compared with [4, Proposition 4.4], the homomorphism φm can be surjective in more cases. For any integer m ≥ 2, we define the set 2 Tm = {a :1 ≤ a ≤ m , gcd(a, m)=1, m is a Carmichael-Wieferich number with base a}.

Actually, Tm is the kernel of the homomorphism φm, then the following result follows directly from Proposition 4.3.

Corollary 4.4. We have |Tm| = d′ϕ(m), where d′ is defined in Propo- sition 4.3. Corollary 4.4 shows that any integer m ≥ 2 can be a Carmichael- Wieferich number with some base. However, the next proposition sug- gests that such Carmichael-Wieferich numbers are rare. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 13

Tm Proposition 4.5. We have lim | 2| =0. m ϕ(m ) →∞ Proof. Denote by d(m) the parameter d in (4.1). By Corollary 4.4, we know that |T | d(m) m ≤ . ϕ(m2) m So, it suffices to prove that lim d(m) = 0. m m For primes p, we have →∞ d(p) 1 lim = lim =0. p p →∞ p →∞ p So lim inf d(m) =0. m m →∞ d(m) Suppose that lim sup m =6 0. Then there exists a subsequence m →∞ { d(ni) } such that lim d(ni) = lim sup d(m) =06 . ni i ni m →∞ m →∞r1 rk For an integer m ≥ 2, let m = p1 ··· pk be its prime factorization. Put αm = max{r1, ··· ,rk}. Here we use the notation in (4.1). For each d(m) rj 1 ≤ j ≤ k, we have m ≤ dj/pj . In particular, if pj is the largest d(m) rj prime factor of m, then m ≤ 2/pj . For each i, let pi be the largest prime factor of ni, we abbreviate d(ni) 2 d(ni) αni to αi. Since ≤ for each i and lim =6 0, there must ni pi i ni →∞ exist an integer q such that pi < q for all i. Put β = 2 (p − 1). 2 p

p 1 σ(a, p) = ordp(a − − 1) − 1 if p is odd; 14 MIN SHA

ord (a − 1) − 1 if a ≡ 1 (mod 4), σ(a, 2) = 2  ord2(a + 1) − 1 if a ≡ 3 (mod 4). Then, we can state an analogue of [4, Proposition 5.4]. For the conve- nience of the reader, we reproduce the proof.

r1 rk Proposition 4.6. Let gcd(a, m)=1, and m = p1 ··· pk be the prime factorization of m ≥ 3. Fix an integer j with 1 ≤ j ≤ k, let p = pj and r = rj. If p =26 or r ≤ 2, put 0 if ord lcm (p − 1, ··· ,p − 1) ≤ r − 1, n = p 1 k  ordplcm (p1 − 1, ··· ,pk − 1) − r +1 otherwise; otherwise if p =2 and r > 2, put 0 if ord lcm (p − 1, ··· ,p − 1) ≤ r − 2, n = p 1 k  ordplcm (p1 − 1, ··· ,pk − 1) − r +2 otherwise. Moreover, put n if p =26 or r ≤ 2, e(m, p)=  n − 1 otherwise. Then we have

ordpCm(a)= e(m, p)+ σ(a, p). Proof. Notice that λ(m)= pnλ(pr)X, where X is an integer with p ∤ X. Put b = apnλ(pr). Then, since

X 1 − aλ(m) − 1= bX − 1=(b − 1) bi, Xi=0 X 1 i b ≡ 1 (mod p) and i=0− b ≡ X 6≡ 0 (mod p), we obtain λ(mP) pnλ(pr) ordp(a − 1) = ordp(b − 1) = ordp(a − 1). Thus, if p is an odd prime, by using [4, Lemma 5.1] we have

λ(m) p 1 pn+r−1 p 1 ordp(a − 1) = ordp((a − ) − 1) = ordp(a − − 1) + n + r − 1, which implies that

ordpCm(a)= e(m, p)+ σ(a, p). Similarly, applying [4, Lemmas 5.1 and 5.3], one can verify the remain- ing case p = 2 by noticing that m ≥ 3.  The next proposition, a criterion for a number m being a Carmichael- Wieferich number, follows directly from Proposition 4.6. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 15

r1 rk Proposition 4.7. Let gcd(a, m)=1, and m = p1 ··· pk be the prime factorization of m ≥ 3. Then the following statements are equivalent: (1) m is a Carmichael-Wieferich number with base a, (2) e(m, pj)+ σ(a, pj) ≥ rj, for any 1 ≤ j ≤ k. Although it is known that Wieferich primes exist for many different bases (see [15]), the following problem is still open. Whether Wieferich primes exist for all bases? Proposition 4.8. For a non-zero integer a, if there exists a Carmichael- Wieferich number m with base a and m has an odd prime factor, then there exists a Wieferich prime with base a.

r1 rk Proof. Let m = p1 ··· pk be the prime factorization of m with p1 < p2 < ···

For this function fm, we have the following proposition.

Proposition 5.2. The function fm is perfect nonlinear if and only if m is a . Proof. First, suppose that m is a prime number. By [6, Lemma 8] (or [5, Theorem 48]) and Proposition 4.3, it is easy to show that fm is perfect nonlinear. Now assume that m is a composite integer. Let p be a prime factor of m. Notice that fm(kp) = 0forany k ≥ 1, and (m+2)p ≤ m(m+2)/2 < m2. Then choosing (p, 0) ∈ Z/m2Z × Z/mZ, we obtain 2 |{x ∈ Z/m Z : fm(x + p) − fm(x)=0}| ≥ |{x = kp :1 ≤ k ≤ m +2}| = m +2 > m.

By definition, the function fm is not perfect nonlinear. 

Thus, the function fm gives a new kind of perfect nonlinear functions when m is a prime number. Furthermore, this kind of perfect nonlinear functions is much more convenient for computations than that given in [5, Example 49].

acknowledgements The author would like to thank Professor Arne Winterhof for sending him the recent work [10]. He wants to thank the referee for careful reading and valuable comments. He is also grateful to the referee of his recent joint paper [14] for pointing our the error in the previous Proposition 4.3.

References [1] T. Agoh, Fermat and Euler type quotients, C. R. Math. Rep. Acad. Sci. Canada, 17 (1995), 159–164. [2] T. Agoh, On Giuga’s conjecture Manuscripta Math., 87 (1995), 501–510. [3] T. Agoh, On Fermat and Wilson quotients, Expo. Math., 14 (1996), 145–170. [4] T. Agoh, K. Dilcher and L. Skula, Fermat quotients for composite moduli,J. , 66 (1997), 29–50. [5] C. Carlet and C. Ding, Highly nonlinear mappings, J. Complexity 20 (2004), 205–244. [6] S. Chansona, C. Ding and A. Salomaab, Cartesian authentication codes from functions with optimal nonlinearity, Theoretical Computer Science, 290 (2003), 1737–1752. [7] Z. Chen, Trace representation and linear complexity of binary sequences derived from Fermat quotients, Sci. China Inf. Sci., 57(11) (2014), 1–10. [8] Z. Chen and X. Du, On the linear complexity of binary threshold sequences derived from Fermat quotients, Des. Codes Cryptogr., 67 (2013), 317–323. THE ARITHMETIC OF CARMICHAEL QUOTIENTS 17

[9] Z. Chen, A. Ostafe and A. Winterhof, Structure of pseudorandom numbers derived from Fermat quotients, in Arithmetic of Finite Fields, Lecture Notes in Computer Science, ed. by M.A. Hasan, T. Helleseth. vol. 6087, pp. 73–85, Springer, Berlin, 2010. [10] Z. Chen and A. Winterhof, On the distribution of pseudorandom numbers and vectors derived from Euler-Fermat quotients, Int. J. Number Theory, 08 (2012), 631–641. [11] A. Granville, Some conjectures related to Fermat’s Last Theorem, in Number Theory, ed. by R.A. Mollin, pp. 177–192, Walter de Gruyter, New York, 1990. [12] M. Lerch, Zur Theorie des Fermatschen Quotienten (ap−1 −1)/p = q(a), Math. Ann., 60 (1905), 471–490. [13] M. Lerch, Sur les th´eor`emes de Sylvester concernant le quotient de Fermat, C. R. Acad. Sci. Paris, 142 (1906), 35–38. [14] F. Luca, M. Sha and I.E. Shparlinski, On two functions arising in the study of the Euler and Carmichael quotients, preprint, 2016. [15] P.L. Montgomery, New solutions of ap−1 ≡ 1 (mod p2), Math. Comp., 61 (1993), 361–363. [16] A. Ostafe and I. Shparlinski, Pseudorandomness and dynamics of Fermat quo- tients, SIAM J. Discr. Math., 25 (2011), 50–71. [17] P. Ribenboim, Thirteen lectures on Fermat’s Last Theorem, Springer, New York, 1979. [18] J. Sauerberg and L. Shu, Fermat quotients over function fields, Finite Fields Th. App., 3 (1997), 275–286. [19] L. Skula, Fermat and Wilson quotients for p-adic integers, Acta Mathematica Universitatis Ostraviensis, (1998) 6, 167–181.

School of Mathematics and Statistics, University of New South Wales, Sydney, NSW 2052, Australia E-mail address: [email protected]