A215486 n - 1 mod phi(n), where phi(n) is Euler's totient function.
0, 0, 0, 1, 0, 1, 0, 3, 2, 1, 0, 3, 0, 1, 6, 7, 0, 5, 0, 3, 8, 1, 0, 7, 4, 1, 8, 3, 0, 5, 0, 15, 12, 1, 10, 11, 0, 1, 14, 7, 0, 5, 0, 3, 20, 1, 0, 15, 6, 9, 18, 3, 0, 17, 14, 7, 20, 1, 0, 11, 0, 1, 26, 31, 16, 5, 0, 3, 24, 21, 0, 23, 0, 1, 34, 3, 16, 5, 0, 15, 26, 1, 0, 11, 20, 1, 30, 7, 0, 17
Offset: 1
Examples
a(8) = 3 because 8 - 1 mod phi(8) = 3. a(9) = 2 because 9 - 1 mod phi(9) = 2. a(10) = 1 because 10 - 1 mod phi(10) = 1.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Wikipedia, Lehmer's totient problem
Programs
-
Magma
[(n-1) mod EulerPhi(n): n in [2..90]]; // Bruno Berselli, Feb 18 2013
-
Mathematica
Table[Mod[n - 1, EulerPhi[n]], {n, 2, 100}]
-
Maxima
makelist(mod(n-1,totient(n)), n, 2, 90); /* Bruno Berselli, Feb 18 2013 */
-
PARI
a(n)=(n-1)%eulerphi(n) \\ Charles R Greathouse IV, Dec 29 2013
Comments