OFFSET
1,3
MATHEMATICA
a[n_] := a[n] = If[IntegerQ[Surd[n, 3]], 0, a[EulerPhi[n]] + 1]; Array[a, 100] (* Amiram Eldar, Jun 14 2023 *)
PROG
(Python)
from sympy import totient, integer_nthroot
def a(n):
x = n
c = 0
while not integer_nthroot(x, 3)[1]:
x = totient(x)
c += 1
return c
(PARI) a(n) = my(nb=0); while(!ispower(n, 3), n=eulerphi(n); nb++); nb; \\ Michel Marcus, Jun 15 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Darío Clavijo, Jun 14 2023
STATUS
approved