OFFSET
1,2
LINKS
David W. Wilson, Table of n, a(n) for n = 1..10000
EXAMPLE
Let S(k) be the sequence (0^k, 1^k, 2^k, ...) mod 8. S(k) is periodic with period 8 and we find that (1,1,1,1,1,1,1,1,...) = S(0), (0,1,2,3,4,5,6,7,...) = S(1), (0,1,4,1,0,1,4,1,...) = S(2), (0,1,0,3,0,5,0,7,...) = S(3) = S(5) = S(7) = ... and (0,1,0,1,0,1,0,1,...) = S(4) = S(6) = S(8) = ... The first A002322(8) = 3 sequences occur for exactly one value of k. The remaining A051903(8) = 2 sequences occur for an infinite number of k. This gives a(8) = 3+2 = 5.
MATHEMATICA
a[n_] := Max[FactorInteger[n][[;; , 2]]] + CarmichaelLambda[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 07 2024 *)
PROG
(PARI) a(n) = if(n == 1, 1, my(f = factor(n)); vecmax(f[, 2]) + lcm(znstar(f)[2])); \\ Amiram Eldar, Sep 07 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David W. Wilson, Oct 13 2007
STATUS
approved