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.

A297025 Number of iterations of A220096 required to reach 0 starting from n.

This page as a plain text file.
%I A297025 #30 Jan 03 2018 14:46:23
%S A297025 0,1,2,3,3,4,4,5,4,4,5,6,5,6,6,5,5,6,5,6,6,6,7,8,6,5,7,5,7,8,6,7,6,7,
%T A297025 7,6,6,7,7,7,7,8,7,8,8,6,9,10,7,6,6,7,8,9,6,7,8,7,9,10,7,8,8,7,7,7,8,
%U A297025 9,8,9,7,8,7,8,8,6,8,7,8,9,8,6,9,10,8,7
%N A297025 Number of iterations of A220096 required to reach 0 starting from n.
%C A297025 Records occur at indices 0, 1, 2, 3, 5, 7, 11, 22, 23, 46, 47, 94, ... (see A297026).
%H A297025 Peter Kagey, <a href="/A297025/b297025.txt">Table of n, a(n) for n = 0..10000</a>
%e A297025 For n = 14, a(14) = 6 because six iterations are required to reach zero:
%e A297025 A220096(14) = 7,
%e A297025 A220096(7)  = 6,
%e A297025 A220096(6)  = 3,
%e A297025 A220096(3)  = 2,
%e A297025 A220096(2)  = 1, and
%e A297025 A220096(1)  = 0.
%t A297025 g[n_Integer] := If[n == 1, 0, Block[{fi = FactorInteger@ n}, If[Plus @@ (Last@# & /@ FactorInteger@n) == 1, n -1, n/fi[[1, 1]] ]]]; f[n_] := Length@ NestWhileList[g, n, # > 0 &] -1; Array[f, 86, 0] (* _Robert G. Wilson v_, Dec 24 2017 *)
%o A297025 (PARI) f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
%o A297025 a(n) = my(nb = 0); while (n, n = f(n); nb++); nb; \\ _Michel Marcus_, Dec 24 2017
%Y A297025 Cf. A220096. Positions of records at A297026.
%Y A297025 Cf. A056792, A061282, A260112.
%K A297025 nonn
%O A297025 0,3
%A A297025 _Peter Kagey_ and _Alec Jones_, Dec 24 2017