OFFSET
0,6
COMMENTS
EXAMPLE
17 (decimal) = 122 -> 122 + 221 = 1120 -> 1120 + 211 = 2101 -> 2101 + 1012 = 10120 -> 10120 + 2101 = 12221 (palindrome) = 160 (decimal) requires 4 steps, so a(17) = 4.
PROG
(ARIBAS) m := 120; stop := 1000; for n := 0 to m do v := -1; c := 0; k := n; while c < stop do d := k; rev := 0; while d > 0 do rev := 3*rev + (d mod 3); d := d div 3; end; if k = rev then v := c; c := stop; else inc(c); k := k + rev; end; end; write(v, ", "); end;
CROSSREFS
KEYWORD
base,sign
AUTHOR
Klaus Brockhaus, Nov 05 2002
STATUS
approved