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.

A261019 Irregular triangle read by rows: T(n,k) (0 <= k <= A261017(n)) = number of binary strings of length n such that the smallest number whose binary representation is not visible in the string is k.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 3, 6, 4, 1, 1, 1, 4, 11, 10, 5, 1, 1, 5, 19, 21, 15, 0, 2, 1, 1, 6, 32, 40, 35, 2, 9, 2, 1, 1, 7, 53, 72, 73, 6, 31, 10, 2, 1, 1, 8, 87, 125, 144, 15, 79, 40, 12, 1, 1, 9, 142, 212, 274, 32, 185, 116, 52, 1, 1, 10, 231, 354, 509, 64, 408, 296, 168, 2, 4
Offset: 1

Views

Author

Alois P. Heinz and N. J. A. Sloane, Aug 17 2015

Keywords

Comments

This is a more compact version of the triangle in A261015, ending each row at the last nonzero entry.

Examples

			The first 16 rows are:
1, 1,
1, 1,  1,    1,
1, 1,  2,    3,    1,
1, 1,  3,    6,    4,    1,
1, 1,  4,   11,   10,    5,
1, 1,  5,   19,   21,   15,    0,     2,
1, 1,  6,   32,   40,   35,    2,     9,     2,
1, 1,  7,   53,   72,   73,    6,    31,    10,     2,
1, 1,  8,   87,  125,  144,   15,    79,    40,    12,
1, 1,  9,  142,  212,  274,   32,   185,   116,    52,
1, 1, 10,  231,  354,  509,   64,   408,   296,   168,    2,    4,
1, 1, 11,  375,  585,  931,  120,   864,   699,   461,   24,   24,
1, 1, 12,  608,  960, 1685,  218,  1771,  1557,  1133,  130,  110,   2,   4,
1, 1, 13,  985, 1568, 3027,  385,  3555,  3325,  2612,  471,  387,  14,  24,  0,  16,
1, 1, 14, 1595, 2553, 5409,  668,  7021,  6893,  5759, 1401, 1135,  92, 120,  0,  90, 16,
1, 1, 15, 2582, 4148, 9628, 1142, 13696, 13964, 12309, 3734, 2972, 373, 439, 28, 390, 98, 16,
...
		

Crossrefs

The row lengths are given by A261017.
Cf. A076478, A030308, A000079 (row sums), A261392 (max per row).

Programs

  • Haskell
    import Data.List (isInfixOf, sort, group)
    a261019 n k = a261019_tabf !! (n-1) !! k
    a261019_row n = a261019_tabf !! (n-1)
    a261019_tabf = map (i 0 . group . sort . map f) a076478_tabf
       where f bs = g a030308_tabf where
               g (cs:css) | isInfixOf cs bs = g css
                          | otherwise = foldr (\d v -> 2 * v + d) 0 cs
             i _ [] = []
             i r gss'@(gs:gss) | head gs == r = (length gs) : i (r + 1) gss
                               | otherwise    = 0 : i (r + 1) gss'
    -- Reinhard Zumkeller, Aug 18 2015