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.

A176839 The number of iterations to reach 1 under the map x -> x-tau(phi(x)), starting at n.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 2, 3, 3, 3, 3, 4, 3, 4, 4, 5, 5, 5, 4, 6, 5, 6, 5, 7, 5, 7, 6, 7, 6, 8, 6, 7, 7, 7, 7, 9, 8, 8, 7, 8, 8, 10, 8, 9, 9, 11, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 10, 11, 11, 12, 11, 12, 12, 12, 12, 12, 12, 13, 11, 12, 13, 13, 12, 13, 13, 13, 12, 13, 14, 14, 14
Offset: 1

Views

Author

Michel Lagneau, Apr 27 2010

Keywords

Comments

Tau(n) = A000005(n) is the number of divisors of n, and phi(n) = A000010(n) is the Euler totient function.

Examples

			a(12)=4 because
f(12) = 12 - tau(phi(12)) = 12 - tau(4) = 12 - 3 = 9;
f(9) = 9 - tau(phi(9)) = 9 - tau(6) = 9 - 4 = 5;
f(5) = 5 - tau(phi(5)) = 5 - tau(4) = 5 - 3 = 2;
f(2) = 2 - tau(phi(2)) = 2 - tau(1) = 2 - 1 = 1, and a(12) = 4.
		

Crossrefs

Cf. A062821.

Programs

  • Maple
    A062821 := proc(n)
            numtheory[tau](numtheory[phi](n)) ;
    end proc:
    A176839 := proc(n)
            a := 0 ;
            x := n ;
            while x <> 1 do
                    x := x-A062821(x) ;
                    a := a+1 ;
            end do:
            a ;
    end proc: # R. J. Mathar, Oct 11 2011
  • Mathematica
    f[n_] := If[n == 1, 1, n - DivisorSigma[0, EulerPhi[n]]];
    a[n_] := Length[FixedPointList[f, n]] - 2;
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 09 2024 *)