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
Michel Lagneau, Table of n, a(n) for n = 1..10000
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