OFFSET
1,1
COMMENTS
The computation of a trajectory was stopped, when within 1000 steps no further palindrome appeared. - A033665(n) + 1 is the index of the first palindrome in the 'Reverse and Add' trajectory of n.
Terms correct for at least 10000 steps after last palindrome. - Sean A. Irvine, Jun 11 2024
EXAMPLE
6, 33, 66, 363, 4884, 8836886388, 47337877873374 are the seven palindromes in the trajectory of 6 and the next 1000 steps do not lead to another palindrome; 47337877873374 is the 31st term in the trajectory, so a(6) = 31.
PROG
(ARIBAS) var st, nst: string; end; for k := 1 to 74 do n := k; j := 1; x := 0; c := 0; while c < 1000 do st := itoa(n); nst := ""; for i := 0 to length(st) - 1 do nst := concat(st[i], nst); end; rev := atoi(nst); if n = rev then c := 0; x := j; end; inc(c); n := n + rev; inc(j); end; write(x, ", " ); end;
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Klaus Brockhaus, May 03 2002
STATUS
approved