login
A207193
Auxiliary function for computing the Carmichael lambda function (A002322).
3
1, 1, 2, 2, 4, 6, 2, 6, 10, 12, 4, 16, 18, 22, 20, 18, 28, 30, 8, 36, 40, 42, 46, 42, 52, 58, 60, 16, 66, 70, 72, 78, 54, 82, 88, 96, 100, 102, 106, 108, 112, 110, 100, 126, 32, 130, 136, 138, 148, 150, 156, 162, 166, 156, 172, 178, 180, 190, 192, 196, 198
OFFSET
1,3
LINKS
FORMULA
a(n) = f(A000961(n)), where f(1) = 1, and f(p^e) = 2^(e-2) if p = 2 and e > 2, and f(p^e) = (p-1)*p^(e-1) otherwise.
MATHEMATICA
f[p_, e_] := If[p == 2 && e > 2, 2^(e-2), (p-1)*p^(e-1)]; s[n_] := If[n == 1, 1, If[PrimePowerQ[n], f @@ (FactorInteger[n][[1]]), Nothing]]; Array[s, 200] (* Amiram Eldar, Apr 05 2025 *)
PROG
(Haskell)
a207193 1 = 1
a207193 n | p == 2 && e > 2 = 2 ^ (e - 2)
| otherwise = (p - 1) * p ^ (e - 1)
where p = a025473 n; e = a025474 n
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 16 2012
STATUS
approved