cp's OEIS Frontend

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.

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.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Jun 14 2007

Keywords

Examples

			Binary representations of the terms in the first few rows:
10
100, 1001
1000, 10001, 10010
10000, 100001, 100010, 100100
		

Crossrefs

Programs

  • 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
  • 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

Extensions

More terms from R. J. Mathar, Oct 17 2007