OFFSET
0,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
MATHEMATICA
rd[n_]:=Module[{rev=FromDigits[Reverse[IntegerDigits[n]]]}, If[ rev>n, rev, 2n]]; NestList[rd, 1, 40] (* Harvey P. Dale, Jan 25 2013 *)
NestList[If[IntegerReverse[#]>#, IntegerReverse[#], 2#]&, 1, 40] (* Harvey P. Dale, Aug 23 2023 *)
PROG
(Haskell)
a041013 n = a041013_list !! n
a041013_list = 1 : f 1 where
f x | rev <= x = (2*x) : f (2*x)
| otherwise = rev : f rev where rev = a004086 x
-- Reinhard Zumkeller, Aug 08 2011
CROSSREFS
KEYWORD
base,nonn,nice
AUTHOR
EXTENSIONS
Typo in definition corrected by K. Viswanathan Iyer, Mar 23 2010
STATUS
approved