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.

A114183 a(1) = 1; for n>1, a(n) = floor(sqrt(a(n-1))) if that number is not already in the sequence, otherwise a(n) = 2a(n-1).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 5, 10, 3, 6, 12, 24, 48, 96, 9, 18, 36, 72, 144, 288, 576, 1152, 33, 66, 132, 11, 22, 44, 88, 176, 13, 26, 52, 7, 14, 28, 56, 112, 224, 448, 21, 42, 84, 168, 336, 672, 25, 50, 100, 200, 400, 20, 40, 80, 160, 320, 17, 34, 68, 136, 272, 544, 23, 46, 92
Offset: 1

Views

Author

Keywords

Comments

One can prove by induction that n must appear in the sequence after [n/2], showing that the sequence is one-to-one; and that frac(log_2(log_2(a(n))) is dense in [0,1), from which it follows that a(n) is onto. - From Franklin T. Adams-Watters, Feb 04 2006
Comment from N. J. A. Sloane, Mar 01 2013: Although the preceding argument seems somewhat incomplete, the result is certainly true: This sequence is a permutation of the natural numbers. Mark Hennings and the United Kingdom Mathematics Trust, and (independently) Max Alekseyev, sent detailed proofs - see the link below.
The sequence consists of a series of "doubling runs", and the starting points and lengths of these runs are in A221715 and A221716 respectively. - N. J. A. Sloane, Jan 27 2013

Crossrefs

See A222193 and A222194 for records.

Programs

  • Haskell
    a114183 n = a114183_list !! (n-1)
    a114183_list = 1 : f [1] where
       f xs@(x:_) = y : f (y : xs) where
         y = if z `notElem` xs then z else 2 * x where z = a000196 x
    -- Reinhard Zumkeller, Mar 05 2013
  • Maple
    See A221715.
  • Mathematica
    a[1] = 1; a[n_] := a[n] = With[{an = Floor[Sqrt[a[n-1]]]}, If[FreeQ[Array[a, n-1], an], an, 2*a[n-1]]]; Table[a[n], {n, 1, 65}] (* Jean-François Alcover, Apr 23 2013 *)

Extensions

Missing negative in definition inserted by D. S. McNeil, May 26 2010
Entry revised by N. J. A. Sloane, Mar 01 2013