OFFSET
1,3
COMMENTS
The iteration step is x -> A062249(x).
a(n) = 1 if and only if n is an odd square or an even nonsquare. - Robert Israel, Oct 31 2024
EXAMPLE
For n = 2, there is a(2) = 1 iteration to an even number: 2 -> 4 (with at least one iteration so 2 itself is not the even number target).
For n = 3 there are a(3) = 4 iterations to reach an even number: 3 -> 5 -> 7 -> 9 -> 12.
MAPLE
f:= proc(n) local x, i;
x:= n;
for i from 1 do x:= x + numtheory:-tau(x); if x::even then return i fi od
end proc:
map(f, [$1..200]); # Robert Israel, Oct 31 2024
MATHEMATICA
a[n_] := -1 + Length@ NestWhileList[# + DivisorSigma[0, #] &, n, OddQ, {2, 1}]; Array[a, 100] (* Amiram Eldar, Oct 31 2024 *)
CROSSREFS
KEYWORD
AUTHOR
Ctibor O. Zizka, Oct 31 2024
STATUS
approved