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.
%I A118319 #39 Mar 09 2025 12:54:26 %S A118319 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 A118319 24,29,26,28,27,63,32,34,33,38,35,37,36,46,39,41,40,45,42,44,43,62,47, %U A118319 49,48,53,50,52,51,61,54,56,55,60,57,59,58,127,64,66,65,70,67,69,68,78 %N A118319 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 A118319 Sequence is a permutation of the positive integers. a(2n-1) is the smallest positive integer not occurring earlier in the sequence. %C A118319 A101925 is the odd bisection, and it seems that A045412 is the sorted even bisection: a(2*n) = A045412(a(n)). - _Andrey Zabolotskiy_, Oct 09 2019 %H A118319 Andrey Zabolotskiy, <a href="/A118319/b118319.txt">Table of n, a(n) for n = 1..8192</a> %H A118319 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A118319 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 %F A118319 a(n) = n + A006519(n) - A000120(n). - _Kevin Ryde_, Mar 08 2025 %e A118319 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 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 %p A118319 a := n -> n + 2^padic[ordp](n, 2) - add(convert(n, base, 2)): seq(a(n), n = 1..72); # _Peter Luschny_, Mar 08 2025 %t A118319 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 *) %o A118319 (PARI) a(n) = n + 1<<valuation(n,2) - hammingweight(n); \\ _Kevin Ryde_, Mar 02 2025 %Y A118319 Cf. A108918 (inverse permutation), A000120, A006519, A045412, A101925. %K A118319 easy,nonn %O A118319 1,2 %A A118319 _Leroy Quet_, Apr 23 2006 %E A118319 More terms from _R. J. Mathar_, Sep 06 2007