A306482 Records for the number of 'Reverse and Add' steps in base 2 needed for a Lychrel number to join the trajectory of a smaller Lychrel number (i.e., its seed). Record setting numbers in A306481.
0, 4, 5, 6, 9, 11, 17, 21, 22, 34, 52, 68, 83, 84, 91, 92, 98
Offset: 1
Programs
-
Mathematica
limit = 200; (* Assumes that there is no palindrome if none is found before "limit" iterations *) A066059 = Select[Range[50000], Length@NestWhileList[# + IntegerReverse[#, 2] &, #, # != IntegerReverse[#, 2] &, 1, limit] == limit + 1 &];utraj = {}; A075252 = Select[Range[50000], (x = NestWhileList[# + IntegerReverse[#, 2] &, #, # != IntegerReverse[#, 2] & , 1, limit]; If[Length@x >= limit && Intersection[x, utraj] == {}, utraj = Union[utraj, x]; True, utraj = Union[utraj, x]]) &];A306482 = {}; best = -1; lastj = 0; utraj = {}; For[i = 1, i <= Length@A066059, i++, For[j = lastj + 1, j <= Length@A075252, j++, If[A066059[[i]] < A075252[[j]], Break[]]; 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[A306482, Length@l - 1]]; ]; A306482 (* Robert Price, Nov 20 2019 *)
Comments