Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #32 Nov 11 2024 22:39:40
%S 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,
%T 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,
%U 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
%N 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.
%C The iteration step is x -> A062249(x).
%C a(n) = 1 if and only if n is an odd square or an even nonsquare. - _Robert Israel_, Oct 31 2024
%e 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).
%e For n = 3 there are a(3) = 4 iterations to reach an even number: 3 -> 5 -> 7 -> 9 -> 12.
%p f:= proc(n) local x,i;
%p x:= n;
%p for i from 1 do x:= x + numtheory:-tau(x); if x::even then return i fi od
%p end proc:
%p map(f, [$1..200]); # _Robert Israel_, Oct 31 2024
%t a[n_] := -1 + Length@ NestWhileList[# + DivisorSigma[0, #] &, n, OddQ, {2, 1}]; Array[a, 100] (* _Amiram Eldar_, Oct 31 2024 *)
%Y Cf. A000005, A062249 (step), A064491 (trajectory of 1).
%K nonn,look
%O 1,3
%A _Ctibor O. Zizka_, Oct 31 2024