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.
%I A330786 #17 Jan 01 2020 15:16:49 %S A330786 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, %T A330786 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, %U A330786 8,6,7,7,8,6,5,6,7,6,7,8,8,6,7,6,7,5,8,6,7,6 %N A330786 Number of steps to reach 1 by iterating the absolute alternating sum-of-divisors function (A206369). %C A330786 A preliminary for investigating iterates of A206369. %D A330786 See A206369. %F A330786 a(1) = 0; for n > 1, a(n) = 1 + a(A206369(n)). %e A330786 Iterating A206369 with a starting value of 27 gives 20, 12, 6, 2, 1, taking 5 steps to reach 1. So a(27) = 5. %t A330786 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 *) %o A330786 (PARI) f(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ A206369 %o A330786 a(n) = {if (n==1, return (0)); my(nb = 1); while ((n = f(n)) != 1, nb++); nb;} \\ _Michel Marcus_, Jan 01 2020 %Y A330786 Cf. A206369. %K A330786 nonn %O A330786 1,3 %A A330786 _Allan C. Wechsler_, Dec 31 2019