cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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, 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, 3, 2, 3, 2, 3, 5, 3, 5, 3, 2, 3, 3, 5, 3, 4, 2, 1, 5, 3
Offset: 1

Views

Author

DarĂ­o Clavijo, Jun 14 2023

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[IntegerQ[Surd[n, 3]], 0, a[EulerPhi[n]] + 1]; Array[a, 100] (* Amiram Eldar, Jun 14 2023 *)
  • PARI
    a(n) = my(nb=0); while(!ispower(n, 3), n=eulerphi(n); nb++); nb; \\ Michel Marcus, Jun 15 2023
  • 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
    
Showing 1-1 of 1 results.