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 A217122 #15 Jul 22 2025 23:38:47 %S A217122 1,2,4,3,6,7,9,5,10,11,13,12,15,16,18,8,17,19,21,20,23,24,26,22,27,28, %T A217122 30,29,32,33,35,14,31,34,37,36,39,40,42,38,43,44,46,45,48,49,51,41,50, %U A217122 52,54,53,56,57,59,55,60,61,63,62,65,66,68,25,58,64,69,67,71,72,74,70,75,76,78,77,80,81,83,73,82,84,86,85,88,89,91,87,92 %N A217122 a(n) = (number of 1's in binary expansion of n)th positive number not among the previous terms. %C A217122 This is a permutation of the positive numbers. %H A217122 Reinhard Zumkeller, <a href="/A217122/b217122.txt">Table of n, a(n) for n = 1..10000</a> %H A217122 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A217122 3 has 2 1's in its binary expansion, and the 2nd positive number not among the previous terms is 4; hence a(3)=4 %o A217122 (Haskell) %o A217122 import Data.List (delete) %o A217122 a217122 n = a217122_list !! (n-1) %o A217122 a217122_list = f 1 [0..] where %o A217122 f x zs = y : f (x + 1) (delete y zs) where %o A217122 y = zs !! a000120 x %o A217122 -- _Reinhard Zumkeller_, May 11 2013 %Y A217122 Cf. A000120: number of 1's in binary expansion of n. %Y A217122 Cf. A225589 (inverse), A075311. %K A217122 nonn,base %O A217122 1,2 %A A217122 _Paul Tek_, Mar 16 2013