cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A004086.

Programs

  • 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
  • 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 *)

Extensions

Typo in definition corrected by K. Viswanathan Iyer, Mar 23 2010