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.

Showing 1-2 of 2 results.

A081118 Triangle of first n numbers per row having exactly n 1's in binary representation.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 23, 27, 29, 31, 47, 55, 59, 61, 63, 95, 111, 119, 123, 125, 127, 191, 223, 239, 247, 251, 253, 255, 383, 447, 479, 495, 503, 507, 509, 511, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1023, 1535, 1791, 1919, 1983, 2015, 2031, 2039, 2043
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 06 2003

Keywords

Comments

T(n,n) = A036563(n+1) = 2^(n+1) - 3.
Numbers of the form 2^t - 2^k - 1, 1 <= k < t.

Examples

			Triangle begins:
.......... 1 ......... ................ 1
........ 3...5 ....... .............. 11 101
...... 7..11..13 ..... .......... 111 1011 1101
... 15..23..27..29 ... ...... 1111 10111 11011 11101
. 31..47..55..59..61 . . 11111 101111 110111 111011 111101.
		

Crossrefs

Programs

  • Haskell
    a081118 n k = a081118_tabl !! (n-1) !! (k-1)
    a081118_row n = a081118_tabl !! (n-1)
    a081118_tabl  = iterate
       (\row -> (map ((+ 1) . (* 2)) row) ++ [4 * (head row) + 1]) [1]
    a081118_list = concat a081118_tabl
    -- Reinhard Zumkeller, Feb 23 2012
  • Mathematica
    Table[2^(n+1)-2^(n-k+1)-1,{n,10},{k,n}]//Flatten (* Harvey P. Dale, Apr 09 2020 *)

Formula

T(n, k) = 2^(n+1) - 2^(n-k+1) - 1, 1<=k<=n.
a(n) = (2^A002260(n)-1)*2^A004736(n)-1; a(n)=(2^i-1)*2^j-1, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 04 2013

A131095 Triangle where n-th row contains the smallest n positive integers (listed in order) with exactly n nonleading 0's in their binary representations and where the smallest term in the n-th row is > that the largest term in the (n-1)th row.

Original entry on oeis.org

2, 4, 9, 17, 18, 20, 33, 34, 36, 40, 65, 66, 68, 72, 80, 129, 130, 132, 136, 144, 160, 257, 258, 260, 264, 272, 288, 320, 513, 514, 516, 520, 528, 544, 576, 640, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176
Offset: 1

Views

Author

Leroy Quet, Jun 14 2007

Keywords

Examples

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

Crossrefs

Programs

  • Haskell
    import Data.List (sort, nub)
    a131095 n k = a131095_tabl !! (n-1) !! (k-1)
    a131095_row n = a131095_tabl !! (n-1)
    a131095_tabl = [2] : [4, 9] : [17, 18, 20] : f 4 [17, 18, 20] where
       f v ws = ys : f (v + 1) ys where
         ys = take v $ dropWhile (<= last ws) $ 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
    A023416 := proc(n) local brep,i ; brep := convert(n,base,2) ; add( 1-op(i,brep),i=1..nops(brep)) ; end: A131095 := proc(rowmax) local a,r,c ; a := 2 ; for r from 1 to rowmax do c := 1 ; while c <= r do if A023416(a) = r then printf("%d, ",a) ; c := c+1 ; fi ; a := a+1 ; od ; od ; end: A131095(10) ; # R. J. Mathar, Jun 15 2007

Extensions

More terms from R. J. Mathar, Jun 15 2007
Showing 1-2 of 2 results.