OFFSET
1,3
COMMENTS
D. Lehmer conjectured that a(k) is never 0. He proved that if such k exists, the corresponding composite n must be odd, squarefree, and divisible by at least 7 primes. Cohen and Haggis showed that such n must be larger than 10^20 and have at least 14 prime factors.
LINKS
Balarka Sen, Table of n, a(n) for n = 1..999
Eric W. Weisstein, Totient Function (MathWorld)
Wikipedia, Euler's totient function
EXAMPLE
a(1) = 1 because the first composite number is 4 and 4 - 1 = 1 mod phi(4).
a(2) = 1 because the second composite is 6 and 6 - 1 = 1 mod phi(6).
a(3) = 3 because the third composite is 8 and 8 - 1 = 3 mod phi(8).
MATHEMATICA
DeleteCases[Table[Mod[n - 1, EulerPhi[n]] - Boole[PrimeQ[n]], {n, 100}], -1] (* Alonso del Arte, Feb 15 2013 *)
Mod[#-1, EulerPhi[#]]&/@Select[Range[200], CompositeQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 14 2019 *)
PROG
(PARI) for(n=1, 300, if(isprime(n)==0, print1((n-1)%eulerphi(n)", ")))
(PARI) forcomposite(n=4, 100, print1((n-1)%eulerphi(n)", ")) \\ Charles R Greathouse IV, Feb 19 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Balarka Sen, Feb 15 2013
STATUS
approved