OFFSET
1,2
LINKS
Peter Cameron, A new constant?, May 23 2021.
FORMULA
a(p) = p for prime p.
a(n) = Sum_{k=0..bigomega(n))} phi(F^k(n)), where F^k(n) is the k-th iterate of F(n) = A032742(n). - Ridouane Oudra, Mar 17 2024
MAPLE
a:= proc(n) option remember; uses numtheory;
`if`(n=1, 1, phi(n)+a(n/min(factorset(n))))
end:
seq(a(n), n=1..80); # Alois P. Heinz, Jun 30 2021
MATHEMATICA
a[1] = 1; a[n_] := a[n] = EulerPhi[n] + a[n/FactorInteger[n][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Jun 30 2021 *)
PROG
(PARI) a(n) = if (n==1, 1, eulerphi(n) + a(n/vecmin(factor(n)[, 1])));
(Python)
from sympy import primefactors, totient as phi
def a(n): return 1 if n == 1 else phi(n) + a(n//min(primefactors(n)))
print([a(n) for n in range(1, 71)]) # Michael S. Branicky, Jun 30 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jun 30 2021
STATUS
approved