A377539 The number of iterations of the map x -> x + A000005(x), starting from n, until reaching an even number, and always at least one iteration taken.
1, 1, 4, 3, 3, 1, 2, 1, 1, 1, 6, 1, 5, 1, 4, 3, 4, 1, 3, 1, 2, 1, 2, 1, 1, 1, 16, 1, 16, 1, 15, 1, 14, 1, 13, 11, 13, 1, 12, 1, 12, 1, 11, 1, 10, 1, 2, 1, 1, 1, 9, 1, 9, 1, 8, 1, 7, 1, 7, 1, 6, 1, 5, 5, 5, 1, 5, 1, 4, 1, 4, 1, 3, 1, 2, 1, 2, 1, 2, 1, 1, 1, 38, 1, 37, 1, 36, 1, 36, 1, 35, 1, 35
Offset: 1
Examples
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.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Programs
-
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 *)
-
PARI
A377539(n) = for(i=1,oo,if(!((n=(n+numdiv(n)))%2),return(i))); \\ Antti Karttunen, Jan 15 2025
Comments