OFFSET
1,1
LINKS
MATHEMATICA
limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
Select[Range[805],
Length@NestWhileList[# + IntegerReverse[#, 3] &, #, # !=
IntegerReverse[#, 3] &, 1, limit] == limit + 1 &] (* Robert Price, Oct 19 2019 *)
PROG
(ARIBAS) m := 900; stop := 1000; for n := 0 to m do c := 0; k := n; b := 1; while b do d := k; rev := 0; while d > 0 do rev := 3*rev + (d mod 3); d := d div 3; end; if k = rev or c = stop then b := 0; else k := k + rev; end; inc(c); end; if c > stop then write(n, ", "); end; end;
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Klaus Brockhaus, Nov 05 2002
EXTENSIONS
Offset changed to 1 by A.H.M. Smeets, Feb 10 2019
STATUS
approved