|
|
A035523
|
|
Reverse and add (in base 3).
|
|
1
|
|
|
1, 2, 4, 8, 16, 32, 96, 160, 320, 960, 1600, 2880, 3520, 6080, 11200, 21440, 62400, 86080, 169280, 338560, 648248, 1902840, 3281200, 6404832, 6510784, 12950936, 25744192, 51882584, 156278688, 261609208, 506142216, 531792640, 1008314456, 2014504120
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
32 = 1012, 1012 + 2101 = 10120 = 96.
|
|
MAPLE
|
option remember;
if n =1 then
1;
else
end if;
|
|
MATHEMATICA
|
NestList[ (Fold[ 3 #1+#2&, 0, Reverse@IntegerDigits[ #, 3 ] ]+#&), 1, 40 ]
Join[{m = 1}, Table[m = m + FromDigits[Reverse[IntegerDigits[m, 3]], 3], {35}]] (* T. D. Noe, May 02 2012 *)
NestList[#+IntegerReverse[#, 3]&, 1, 40] (* The program uses the IntegerRevese function from Mathematica version 10 *) (* Harvey P. Dale, Feb 21 2016 *)
|
|
PROG
|
(Python)
def reversedigits(n, b=10): # reverse digits of n in base b
x, y = n, 0
while x >= b:
x, r = divmod(x, b)
y = b*y + r
return b*y + x
for _ in range(50):
l += reversedigits(l, 3)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,nice,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|