OFFSET
0,2
LINKS
T. D. Noe, Table of n, a(n) for n = 0..500
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
KEYWORD
nonn,easy,nice,base
AUTHOR
EXTENSIONS
More terms from Wouter Meeussen
STATUS
approved