login
a(n) = number of 'Reverse and Add!' operations that have to be applied to the n-th term of A063049 in order to obtain a term in the trajectory of 196.
1

%I #8 Oct 21 2019 19:28:11

%S 1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,

%T 1,1,1,1,1,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,1,1,1,1,1,

%U 1,1,1,1,1,1,2,1,2,1,2,1,1,1,1,0,1,1,1,2,2,2,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1

%N a(n) = number of 'Reverse and Add!' operations that have to be applied to the n-th term of A063049 in order to obtain a term in the trajectory of 196.

%H <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>

%e 394 is a term of A063049. One 'Reverse and Add!' operation applied to 394 leads to a term (887) in the trajectory of 196, so the corresponding term of the present sequence is 1.

%t limit = 10^3; x = NestList[ # + IntegerReverse[#] &, 196, limit];

%t y = Select[Range[197, 4942],

%t Intersection[NestList[ # + IntegerReverse[#] &, #, limit],

%t x] != {} &];

%t Table[

%t Length@NestWhileList[# + IntegerReverse[#] &,

%t y[[i]], ! MemberQ[x, #] &] - 1, {i, Length[y]}]

%t (* _Robert Price_, Oct 21 2019 *)

%Y A023108, A033865, A006960, A063049.

%K base,nonn

%O 0,41

%A _Klaus Brockhaus_, Jul 07 2001