login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A035524
Reverse and add (in base 4).
7
1, 2, 4, 5, 10, 20, 25, 50, 85, 170, 340, 425, 850, 1385, 3070, 6140, 10225, 15335, 29410, 65135, 129070, 317675, 1280860, 2163725, 3999775, 7999550, 20321515, 81946460, 138412045, 255852575, 511705150, 1300234475, 5242880860
OFFSET
0,2
FORMULA
a(n+1) = A055948(a(n)), a(0) = 1. [Reinhard Zumkeller, Oct 10 2011]
MATHEMATICA
nxt4[n_]:=Module[{idn4=IntegerDigits[n, 4]}, FromDigits[idn4+ Reverse[idn4], 4]]; NestList[nxt4, 1, 40] (* Harvey P. Dale, May 02 2011 *)
PROG
(Haskell)
a035524 n = a035524_list !! n
a035524_list = iterate a055948 1
-- Reinhard Zumkeller, Oct 10 2011
(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
A035524_list, l = [1], 1
for _ in range(50):
....l += reversedigits(l, 4)
....A035524_list.append(l)
CROSSREFS
Cf. A035522.
Cf. A030103.
Sequence in context: A161706 A128401 A018467 * A018283 A249398 A018489
KEYWORD
nonn,easy,nice,base
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Sep 22 2000
STATUS
approved