|
|
A077404
|
|
Trajectory of n under the Reverse and Add! operation carried out in base 3 (presumably) does not reach a palindrome.
|
|
7
|
|
|
103, 127, 167, 176, 180, 183, 185, 191, 197, 200, 206, 207, 209, 215, 221, 230, 239, 291, 309, 318, 340, 358, 369, 376, 387, 394, 396, 413, 418, 431, 436, 449, 454, 467, 472, 582, 600, 618, 636, 655, 660, 673, 678, 691, 696, 709, 714, 746, 776, 803, 805
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|