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.

A101369 a(2n-1) = the smallest positive integer not occurring earlier in the sequence. a(2n) = the a(2n-1)th smallest positive integer among those not occurring earlier in the sequence.

This page as a plain text file.
%I A101369 #14 Apr 09 2014 10:12:20
%S A101369 1,2,3,6,4,9,5,12,7,16,8,19,10,23,11,26,13,30,14,33,15,36,17,40,18,43,
%T A101369 20,47,21,50,22,53,24,57,25,60,27,64,28,67,29,70,31,74,32,77,34,81,35,
%U A101369 84,37,88,38,91,39,94,41,98,42,101,44,105,45,108,46,111,48,115,49,118
%N A101369 a(2n-1) = the smallest positive integer not occurring earlier in the sequence. a(2n) = the a(2n-1)th smallest positive integer among those not occurring earlier in the sequence.
%C A101369 A permutation of the positive integers.
%H A101369 Reinhard Zumkeller, <a href="/A101369/b101369.txt">Table of n, a(n) for n = 1..10000</a>
%H A101369 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A101369 a(n)<a(n+2). - _Robert G. Wilson v_, Feb 11 2005
%F A101369 For n>0, a(2n-1)=1+floor((2n-1)/sqrt(2)) and a(2n)=2n+floor((2n)/sqrt(2)-1/sqrt(2)) - _Benoit Cloitre_, Feb 22 2005
%t A101369 lst = Range[150]; a[n_] := a[n] = If[ OddQ[n], b = First[lst]; lst = Rest[lst]; b, b = lst[[ a[n - 1]]]; lst = Drop[lst, {a[n - 1]}]; b]; Table[ a[n], {n, 70}]
%o A101369 (Haskell)
%o A101369 import Data.List (delete)
%o A101369 a101369 n = a101369_list !! (n-1)
%o A101369 a101369_list = f [1..] where
%o A101369    f (x:xs) = x : y : f (delete y xs) where y = xs !! (x - 1)
%o A101369 -- _Reinhard Zumkeller_, Jul 01 2013
%Y A101369 Cf. A101438 (inverse).
%K A101369 nonn,nice
%O A101369 1,2
%A A101369 _Leroy Quet_, Jan 13 2005
%E A101369 More terms from _Robert G. Wilson v_, Feb 11 2005