%I #29 Oct 10 2019 07:37:56
%S 1,3,2,7,4,6,5,15,8,10,9,14,11,13,12,31,16,18,17,22,19,21,20,30,23,25,
%T 24,29,26,28,27,63,32,34,33,38,35,37,36,46,39,41,40,45,42,44,43,62,47,
%U 49,48,53,50,52,51,61,54,56,55,60,57,59,58,127,64,66,65,70,67,69,68,78
%N a(n) = (highest power of 2 dividing n)th integer among those positive integers not occurring in {a(1),a(2),a(3),...,a(n-1)}.
%C Sequence is a permutation of the positive integers. a(2n-1) is the smallest positive integer not occurring earlier in the sequence.
%C It seems that A101925 is the odd bisection, A045412 is the sorted even bisection: a(2*n) = A045412(a(n)). - _Andrey Zabolotskiy_, Oct 09 2019
%H Andrey Zabolotskiy, <a href="/A118319/b118319.txt">Table of n, a(n) for n = 1..8192</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(2^m) = 2^(m+1) - 1; a(2^m+k) = a(k) + 2^m - 1 for 0 < k < 2^m. - _Andrey Zabolotskiy_, Oct 10 2019
%e 4 is the highest power of 2 dividing 12. Those positive integers not occurring among the first 11 terms of the sequence form the sequence 11, 12, 13, 14, 16,... Now 14 is the 4th of these integers, so a(12) = 14.
%p A118319 := proc(nmin) local a,anxt,i,n ; a := [1] ; while nops(a) < nmin do n := nops(a)+1 ; i := 2^A007814(n); anxt := 0 ; while i > 0 do anxt := anxt+1 ; while anxt in a do anxt := anxt+1 ; od ; i := i-1; od ; a := [op(a),anxt] ; od; a ; end: A118319(80) ; # _R. J. Mathar_, Sep 06 2007
%t a[1] := 1; a[n_] := a[n] = Part[ Complement[ Range[2 n], Table[a[i], {i, n - 1}]], 2^IntegerExponent[n, 2]]; Array[a, 100] (* _Birkas Gyorgy_, Jul 09 2012 *)
%Y Cf. A108918 (inverse permutation), A006519, A045412, A101925.
%K easy,nonn
%O 1,2
%A _Leroy Quet_, Apr 23 2006
%E More terms from _R. J. Mathar_, Sep 06 2007