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.

A330786 Number of steps to reach 1 by iterating the absolute alternating sum-of-divisors function (A206369).

Original entry on oeis.org

0, 1, 2, 3, 4, 2, 3, 5, 4, 4, 5, 3, 4, 3, 6, 6, 7, 4, 5, 4, 4, 5, 6, 5, 5, 4, 5, 5, 6, 6, 7, 5, 5, 7, 6, 5, 6, 5, 6, 5, 6, 4, 5, 7, 6, 6, 7, 6, 6, 5, 6, 6, 7, 5, 6, 7, 6, 6, 7, 6, 7, 7, 5, 6, 7, 5, 6, 7, 8, 6, 7, 7, 8, 6, 5, 6, 7, 6, 7, 8, 8, 6, 7, 6, 7, 5, 8, 6, 7, 6
Offset: 1

Views

Author

Allan C. Wechsler, Dec 31 2019

Keywords

Comments

A preliminary for investigating iterates of A206369.

Examples

			Iterating A206369 with a starting value of 27 gives 20, 12, 6, 2, 1, taking 5 steps to reach 1. So a(27) = 5.
		

References

Crossrefs

Cf. A206369.

Programs

  • Mathematica
    f[p_,e_] := Sum[(-1)^(e-k)*p^k, {k,0,e}]; s[1] = 1; s[n_] := Times @@ (f @@@ FactorInteger[n]); a[n_] := Length @ FixedPointList[s, n] - 2; Array[a, 90] (* Amiram Eldar, Jan 01 2020 *)
  • PARI
    f(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ A206369
    a(n) = {if (n==1, return (0)); my(nb = 1); while ((n = f(n)) != 1, nb++); nb;} \\ Michel Marcus, Jan 01 2020

Formula

a(1) = 0; for n > 1, a(n) = 1 + a(A206369(n)).