login
A131094
Triangle where n-th row contains the smallest n positive integers (listed in order) with exactly n nonleading 0's in their binary representations.
3
2, 4, 9, 8, 17, 18, 16, 33, 34, 36, 32, 65, 66, 68, 72, 64, 129, 130, 132, 136, 144, 128, 257, 258, 260, 264, 272, 288, 256, 513, 514, 516, 520, 528, 544, 576, 512, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1024, 2049, 2050, 2052, 2056, 2064, 2080, 2112
OFFSET
1,1
LINKS
EXAMPLE
Binary representations of the terms in the first few rows:
10
100, 1001
1000, 10001, 10010
10000, 100001, 100010, 100100
MAPLE
A080791 := proc(n) local bdigs ; bdigs := convert(n, base, 2) ; nops(bdigs)-add(i, i=bdigs) ; end: A131094 := proc(n) local a, i; a := [] ; i := 2^n ; while nops(a) < n do while A080791(i) <> n do i := i+1 ; od: a := [op(a), i] ; i := i+1 ; od: RETURN(a) ; end: seq(op(A131094(n)), n=1..10) ; # R. J. Mathar, Oct 17 2007
PROG
(Haskell)
import Data.List (sort, nub)
a131094 n k = a131094_tabl !! (n-1) !! (k-1)
a131094_row n = a131094_tabl !! (n-1)
a131094_tabl = [2] : f 2 [2] where
f v ws = ys : f (v + 1) ys where
ys = take v $ nub $ sort $ concatMap h ws
h z = [2 * z, 4 * z + 1, 4 * z' + b] where (z', b) = divMod z 2
-- Reinhard Zumkeller, Feb 11 2015
CROSSREFS
Sequence in context: A179219 A367726 A033149 * A129598 A256017 A125752
KEYWORD
nonn,tabl
AUTHOR
Leroy Quet, Jun 14 2007
EXTENSIONS
More terms from R. J. Mathar, Oct 17 2007
STATUS
approved