login
Number of iterations of phi(x) at n needed to reach a cube.
0

%I #12 Jun 15 2023 20:06:35

%S 0,1,2,2,3,2,3,0,3,3,4,3,4,3,1,1,2,3,4,1,4,4,5,1,2,4,0,4,5,1,2,2,2,2,

%T 2,4,5,4,2,2,3,4,5,2,2,5,6,2,5,2,3,2,3,4,3,2,5,5,6,2,3,2,5,0,3,2,3,3,

%U 3,2,3,2,3,5,3,5,3,2,3,3,5,3,4,2,1,5,3

%N Number of iterations of phi(x) at n needed to reach a cube.

%t a[n_] := a[n] = If[IntegerQ[Surd[n, 3]], 0, a[EulerPhi[n]] + 1]; Array[a, 100] (* _Amiram Eldar_, Jun 14 2023 *)

%o (Python)

%o from sympy import totient, integer_nthroot

%o def a(n):

%o x = n

%o c = 0

%o while not integer_nthroot(x,3)[1]:

%o x = totient(x)

%o c += 1

%o return c

%o (PARI) a(n) = my(nb=0); while(!ispower(n, 3), n=eulerphi(n); nb++); nb; \\ _Michel Marcus_, Jun 15 2023

%Y Cf. A000010, A363612, A003434.

%K nonn

%O 1,3

%A _DarĂ­o Clavijo_, Jun 14 2023