|
MATHEMATICA
|
limit = 200; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
Length@NestWhileList[# + IntegerReverse[#, 2] &, #, # !=
IntegerReverse[#, 2] &, 1, limit] == limit + 1 &];
utraj = {};
(x = NestWhileList[# + IntegerReverse[#, 2] &, #, # !=
IntegerReverse[#, 2] & , 1, limit];
If[Length@x >= limit && Intersection[x, utraj] == {},
utraj = Union[utraj, x]; True,
utraj = Union[utraj, x]]) &];
A306481 = {}; best = -1; lastj = 0;
utraj = {};
For[i = 1, i <= Length@A066059, i++,
For[j = lastj + 1, j <= Length@A075252, j++,
utraj = Union[utraj, NestList[# + IntegerReverse[#, 2] &, A075252[[j]], limit]];
lastj = j; ];
l = NestWhileList[# + IntegerReverse[#, 2] &,
A066059[[i]], ! MemberQ[utraj, #] &, 1, limit];
If[Length@l == limit + 1, Continue[]];
If[Length@l > best, best = Length@l; AppendTo[A306481, A066059[[i]]]];
|