login
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
OFFSET
0,2
FORMULA
a(n) = A055946(a(n-1)). - R. J. Mathar, May 28 2016
EXAMPLE
32 = 1012, 1012 + 2101 = 10120 = 96.
MAPLE
A035523 := proc(n)
option remember;
if n =1 then
1;
else
A055946(procname(n-1)) ;
end if;
end proc: # R. J. Mathar, May 28 2016
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
A035523_list, l = [1], 1
for _ in range(50):
l += reversedigits(l, 3)
A035523_list.append(l)
# Chai Wah Wu, Jan 03 2015
CROSSREFS
Cf. A035522.
Sequence in context: A359389 A275072 A290555 * A290301 A195458 A264656
KEYWORD
nonn,easy,nice,base
EXTENSIONS
More terms from Wouter Meeussen
STATUS
approved