login
A219175
a(n) = n mod lambda(n) where lambda is the Carmichael function (A002322).
5
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,9
COMMENTS
a(n) = A068494(n) for n = 1..14.
a(k) = 1 for k = prime(n) > 2 or k = A002997(n).
a(n) is the smallest k >= 0 such that b^(n-k) == 1 (mod n) for every b coprime to n. - Thomas Ordowski, Jun 30 2017
LINKS
EXAMPLE
a(9) = 3 because lambda(9) = 6 and 9 == 3 mod 6.
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 *)
PROG
(PARI) a(n)=n%lcm(znstar(n)[2]) \\ Charles R Greathouse IV, Nov 13 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 13 2012
STATUS
approved