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).
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
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..10000
- Mark Hennings and the United Kingdom Mathematics Trust, Proof that the sequence is a permutation of the natural numbers. An essentially identical proof was contributed by Max Alekseyev.
- N. J. A. Sloane, Table of n, a(n) for n = 1..100000
- Index entries for sequences that are permutations of the natural numbers
Crossrefs
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
Comments