A219175 a(n) = n mod lambda(n) where lambda is the Carmichael function (A002322).
0, 0, 1, 0, 1, 0, 1, 0, 3, 2, 1, 0, 1, 2, 3, 0, 1, 0, 1, 0, 3, 2, 1, 0, 5, 2, 9, 4, 1, 2, 1, 0, 3, 2, 11, 0, 1, 2, 3, 0, 1, 0, 1, 4, 9, 2, 1, 0, 7, 10, 3, 4, 1, 0, 15, 2, 3, 2, 1, 0, 1, 2, 3, 0, 5, 6, 1, 4, 3, 10, 1, 0, 1, 2, 15, 4, 17, 6, 1, 0, 27, 2, 1, 0, 5
Offset: 1
Keywords
Examples
a(9) = 3 because lambda(9) = 6 and 9 == 3 mod 6.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory):for n from 1 to 100 do: x:=irem(n,lambda(n)): printf(`%d, `,x):od:
-
Mathematica
Table[Mod[n, CarmichaelLambda[n]], {n, 100}] (* T. D. Noe, Nov 13 2012 *)
-
PARI
a(n)=n%lcm(znstar(n)[2]) \\ Charles R Greathouse IV, Nov 13 2012
Comments