login
A217122
a(n) = (number of 1's in binary expansion of n)th positive number not among the previous terms
4
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, 30, 29, 32, 33, 35, 14, 31, 34, 37, 36, 39, 40, 42, 38, 43, 44, 46, 45, 48, 49, 51, 41, 50, 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
OFFSET
1,2
COMMENTS
This is a permutation of the positive numbers.
EXAMPLE
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
PROG
(Haskell)
import Data.List (delete)
a217122 n = a217122_list !! (n-1)
a217122_list = f 1 [0..] where
f x zs = y : f (x + 1) (delete y zs) where
y = zs !! a000120 x
-- Reinhard Zumkeller, May 11 2013
CROSSREFS
Cf. A000120: number of 1's in binary expansion of n.
Cf. A225589 (inverse), A075311.
Sequence in context: A358467 A006016 A227413 * A239622 A245604 A054239
KEYWORD
nonn,base
AUTHOR
Paul Tek, Mar 16 2013
STATUS
approved