OFFSET
1,2
COMMENTS
The corresponding record values are 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 13, ... (see the link for more values).
LINKS
EXAMPLE
The iterations of A033880 over the first 8 terms:
n | a(n) | Iterations
--+------+----------------------------------------------------------------
1 | 1 | 1 -> -1
2 | 12 | 12 -> 4 -> -1
3 | 24 | 24 -> 12 -> 4 -> -1
4 | 90 | 90 -> 54 -> 12 -> 4 -> -1
5 | 204 | 204 -> 96 -> 60 -> 48 -> 28 -> 0
6 | 330 | 330 -> 204 -> 96 -> 60 -> 48 -> 28 -> 0
7 | 540 | 540 -> 600 -> 660 -> 696 -> 408 -> 264 -> 192 -> 124 -> -24
8 | 1080 | 1080 -> 1440 -> 2034 -> 378 -> 204 -> 96 -> 60 -> 48 -> 28 -> 0
MATHEMATICA
ab[n_] := Module[{k}, If[n < 1, 0, k = DivisorSigma[1, n] - 2*n; If[k < 1, 0, k]]]; f[n_] := Module[{s = NestWhileList[ab, n, UnsameQ, All]}, If[s[[-1]] == 0, Length[s] - 2, 0]]; seq[max_] := Module[{fm = 0, f1, s = {}}, Do[f1 = f[n]; If[f1 > fm, fm = f1; AppendTo[s, n]], {n, 1, max}]; s]; seq[10^5]
PROG
(PARI) ab(n) = {my(k); if(n < 1, 0, k = sigma(n) - 2*n; if(k < 1, 0, k)); }
f(n) = {my(t = 0); until(bittest(t, n = ab(n)), t += 1<<n); if(n == 0, hammingweight(t) - 1, 0); } \\ after M. F. Hasler at A098007
lista(kmax) = {my(fm = 0, f1); for(k = 1, kmax, f1 = f(k); if(f1 > fm, fm = f1; print1(k, ", "))); }
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Amiram Eldar, Apr 12 2024
STATUS
approved