[go: up one dir, main page]

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”).

A041013
Reverse or double: if reverse of a(n) > a(n), then a(n+1) = a(n) reversed, otherwise a(n+1) = 2*a(n).
1
1, 2, 4, 8, 16, 61, 122, 221, 442, 884, 1768, 8671, 17342, 24371, 48742, 97484, 194968, 869491, 1738982, 2898371, 5796742, 11593484, 48439511, 96879022, 193758044, 440857391, 881714782, 1763429564, 4659243671, 9318487342, 18636974684, 48647963681
OFFSET
0,2
LINKS
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
Cf. A004086.
Sequence in context: A018681 A367172 A018735 * A018754 A264980 A318151
KEYWORD
base,nonn,nice
AUTHOR
EXTENSIONS
Typo in definition corrected by K. Viswanathan Iyer, Mar 23 2010
STATUS
approved