login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A297025 Number of iterations of A220096 required to reach 0 starting from n. 2
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, 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, 9, 8, 9, 7, 8, 7, 8, 8, 6, 8, 7, 8, 9, 8, 6, 9, 10, 8, 7 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
COMMENTS
Records occur at indices 0, 1, 2, 3, 5, 7, 11, 22, 23, 46, 47, 94, ... (see A297026).
LINKS
EXAMPLE
For n = 14, a(14) = 6 because six iterations are required to reach zero:
A220096(14) = 7,
A220096(7) = 6,
A220096(6) = 3,
A220096(3) = 2,
A220096(2) = 1, and
A220096(1) = 0.
MATHEMATICA
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 *)
PROG
(PARI) f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
a(n) = my(nb = 0); while (n, n = f(n); nb++); nb; \\ Michel Marcus, Dec 24 2017
CROSSREFS
Cf. A220096. Positions of records at A297026.
Sequence in context: A317658 A277615 A064066 * A325134 A218007 A060607
KEYWORD
nonn
AUTHOR
Peter Kagey and Alec Jones, Dec 24 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:38 EDT 2024. Contains 371967 sequences. (Running on oeis4.)