OFFSET
1,3
COMMENTS
From David A. Corneth, Dec 24 2017: (Start)
If n > 2 then a(n) <= 2 * a(n - 1). Proof: 2 * a(n - 1) is even. After one iteration of A220096, we get a(n - 1), which gives a record.
MATHEMATICA
With[{s = Array[Length@ NestWhileList[If[#1 == 1, 0, If[Total[#2[[All, -1]] ] == 1, #1 - 1, #1/#2[[1, 1]] ]] & @@ {#, FactorInteger@ #} &, #, # > 0 &] - 1 &, 2^18, 0] }, FirstPosition[s, #][[1]] - 1 & /@ Union@ FoldList[Max, s]] (* Michael De Vlieger, Dec 24 2017, after Robert G. Wilson v at A297025 *)
PROG
(PARI) f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
nb(n) = my(nb = 0); while (n, n = f(n); nb++); nb;
lista(nn) = {my(rec = - 1); for (n=0, nn, if ((m=nb(n)) > rec, rec = m; print1(n, ", ")); ); } \\ Michel Marcus, Dec 24 2017
(PARI) first(n) = {n = max(n, 2); my(res = vector(n), i = 3, c = 2, m = 1); res[1] = 0; res[2] = 1; while(i <= n, forprime(p = res[i-1] + 1, 2*res[i-1], c = A297025(p); if(c > m, m = c; res[i] = p; i++; next(2))); if(res[i] == 0, res[i] = 2 * res[i-1]; i++; m++)); res}
A220096(n) = if(n == 1, return(0)); my(f = factor(n)); if(vecsum(f[, 2])==1, n-1, n / f[1, 1])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Dec 24 2017
EXTENSIONS
a(29)-a(33) from Michel Marcus, Dec 24 2017
More terms from David A. Corneth, Dec 24 2017
STATUS
approved