login
a(2n-1) = 1; a(2n) = a(n)th smallest positive integer not among the earlier terms of the sequence.
2

%I #8 Mar 14 2015 16:54:02

%S 1,2,1,4,1,3,1,8,1,5,1,9,1,6,1,16,1,7,1,14,1,10,1,21,1,11,1,19,1,12,1,

%T 32,1,13,1,24,1,15,1,34,1,17,1,30,1,18,1,45,1,20,1,36,1,22,1,47,1,23,

%U 1,40,1,25,1,64,1,26,1,44,1,27,1,59,1,28,1,51,1,29,1,74,1,31,1,56,1,33,1

%N a(2n-1) = 1; a(2n) = a(n)th smallest positive integer not among the earlier terms of the sequence.

%C The sequence {a(2k)} forms a permutation of the integers >= 2.

%e a(12) = the a(6)th (the 3rd) smallest positive integer not among the first 11 terms of the sequence. Not among the first 11 terms are 6, 7, 9, 10,... The 3rd of these is 9, which is a(12).

%t a[1] = 1; a[n_] := a[n] = If[ OddQ[n], 1, Complement[ Range[100], Union[ Table[ a[i], {i, n - 1}]]][[a[n/2]] ]]; Table[ a[n], {n, 90}] (* _Robert G. Wilson v_, Jan 13 2005 *)

%K easy,nonn

%O 1,2

%A _Leroy Quet_, Dec 17 2004

%E More terms from _Robert G. Wilson v_, Jan 13 2005