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.

A319411 Triangle read by rows: T(n,k) = number of binary vectors of length n with runs-resistance k (1 <= k <= n).

Original entry on oeis.org

2, 2, 2, 2, 2, 4, 2, 4, 6, 4, 2, 2, 12, 12, 4, 2, 6, 30, 18, 8, 0, 2, 2, 44, 44, 32, 4, 0, 2, 6, 82, 76, 74, 16, 0, 0, 2, 4, 144, 138, 172, 52, 0, 0, 0, 2, 6, 258, 248, 350, 156, 4, 0, 0, 0, 2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0, 2, 10, 790, 752, 1500, 938, 104, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Sep 20 2018

Keywords

Comments

"Runs-resistance" is defined in A318928.
Row sums are 2,4,8,16,... (the binary vectors may begin with 0 or 1).
This is similar to A329767 but without the k = 0 column and with a different row n = 1. - Gus Wiseman, Nov 25 2019

Examples

			Triangle begins:
2,
2, 2,
2, 2, 4,
2, 4, 6, 4,
2, 2, 12, 12, 4,
2, 6, 30, 18, 8, 0,
2, 2, 44, 44, 32, 4, 0,
2, 6, 82, 76, 74, 16, 0, 0,
2, 4, 144, 138, 172, 52, 0, 0, 0,
2, 6, 258, 248, 350, 156, 4, 0, 0, 0,
2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0,
2, 10, 790, 752, 1500, 938, 104, 0, 0, 0, 0, 0,
...
Lenormand gives the first 20 rows.
The calculation of row 4 is as follows.
We may assume the first bit is a 0, and then double the answers.
vector / runs / steps to reach a single number:
0000 / 4 / 1
0001 / 31 -> 11 -> 2 / 3
0010 / 211 -> 12 -> 11 -> 2 / 4
0011 / 22 -> 2 / 2
0100 / 112 -> 21 -> 11 -> 2 / 4
0101 / 1111 -> 4 / 2
0110 / 121 -> 111 -> 3 / 3
0111 / 13 -> 11 -> 2 / 3
and we get 1 (once), 2 (twice), 3 (three times) and 4 (twice).
So row 4 is: 2,4,6,4.
		

Crossrefs

Row sums are A000079.
Column k = 2 is 2 * A032741 = A319410.
Column k = 3 is 2 * A329745 (because runs-resistance 2 for compositions corresponds to runs-resistance 3 for binary words).
The version for compositions is A329744.
The version for partitions is A329746.
The number of nonzero entries in row n > 0 is A319412(n).
The runs-resistance of the binary expansion of n is A318928.

Programs

  • Mathematica
    runsresist[q_]:=If[Length[q]==1,1,Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1];
    Table[Length[Select[Tuples[{0,1},n],runsresist[#]==k&]],{n,10},{k,n}] (* Gus Wiseman, Nov 25 2019 *)

A329767 Triangle read by rows where T(n,k) is the number of binary words of length n >= 0 with runs-resistance k, 0 <= k <= n.

Original entry on oeis.org

1, 2, 0, 0, 2, 2, 0, 2, 2, 4, 0, 2, 4, 6, 4, 0, 2, 2, 12, 12, 4, 0, 2, 6, 30, 18, 8, 0, 0, 2, 2, 44, 44, 32, 4, 0, 0, 2, 6, 82, 76, 74, 16, 0, 0, 0, 2, 4, 144, 138, 172, 52, 0, 0, 0, 0, 2, 6, 258, 248, 350, 156, 4, 0, 0, 0, 0, 2, 2, 426, 452, 734, 404, 28, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Nov 21 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers with sum n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.
Except for the k = 0 column and the n = 0 and n = 1 rows, this is the triangle appearing on page 3 of Lenormand, which is A319411. Unlike A318928, we do not here require that a(n) >= 1.
The n = 0 row is chosen to ensure that the row-sums are A000079, although the empty word arguably has indeterminate runs-resistance.

Examples

			Triangle begins:
   1
   2   0
   0   2   2
   0   2   2   4
   0   2   4   6   4
   0   2   2  12  12   4
   0   2   6  30  18   8   0
   0   2   2  44  44  32   4   0
   0   2   6  82  76  74  16   0   0
   0   2   4 144 138 172  52   0   0   0
   0   2   6 258 248 350 156   4   0   0   0
   0   2   2 426 452 734 404  28   0   0   0   0
For example, row n = 4 counts the following words:
  0000  0011  0001  0010
  1111  0101  0110  0100
        1010  0111  1011
        1100  1000  1101
              1001
              1110
		

Crossrefs

Row sums are A000079.
Column k = 2 is A319410.
Column k = 3 is 2 * A329745.
The version for compositions is A329744.
The version for partitions is A329746.
The number of nonzero entries in row n > 0 is A319412(n).
The runs-resistance of the binary expansion of n is A318928.

Programs

  • Mathematica
    runsres[q_]:=If[Length[q]==1,0,Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1];
    Table[Length[Select[Tuples[{0,1},n],runsres[#]==k&]],{n,0,10},{k,0,n}]
Showing 1-2 of 2 results.