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-10 of 13 results. Next

A228273 T(n,k) is the number of s in {1,...,n}^n having longest ending contiguous subsequence with the same value of length k; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 18, 6, 3, 0, 192, 48, 12, 4, 0, 2500, 500, 100, 20, 5, 0, 38880, 6480, 1080, 180, 30, 6, 0, 705894, 100842, 14406, 2058, 294, 42, 7, 0, 14680064, 1835008, 229376, 28672, 3584, 448, 56, 8, 0, 344373768, 38263752, 4251528, 472392, 52488, 5832, 648, 72, 9
Offset: 0

Views

Author

Alois P. Heinz, Aug 19 2013

Keywords

Examples

			T(0,0) = 1: [].
T(1,1) = 1: [1].
T(2,1) = 2: [1,2], [2,1].
T(2,2) = 2: [1,1], [2,2].
T(3,1) = 18: [1,1,2], [1,1,3], [1,2,1], [1,2,3], [1,3,1], [1,3,2], [2,1,2], [2,1,3], [2,2,1], [2,2,3], [2,3,1], [2,3,2], [3,1,2], [3,1,3], [3,2,1], [3,2,3], [3,3,1], [3,3,2].
T(3,2) = 6: [1,2,2], [1,3,3], [2,1,1], [2,3,3], [3,1,1], [3,2,2].
T(3,3) = 3: [1,1,1], [2,2,2], [3,3,3].
Triangle T(n,k) begins:
  1;
  0,        1;
  0,        2,       2;
  0,       18,       6,      3;
  0,      192,      48,     12,     4;
  0,     2500,     500,    100,    20,    5;
  0,    38880,    6480,   1080,   180,   30,   6;
  0,   705894,  100842,  14406,  2058,  294,  42,  7;
  0, 14680064, 1835008, 229376, 28672, 3584, 448, 56,  8;
		

Crossrefs

Row sums give: A000312.
Columns k=0-4 give: A000007, A066274(n) = 2*A081131(n) for n>1, A053506(n) for n>2, A055865(n-1) = A085389(n-1) for n>3, A085390(n-1) for n>4.
Main diagonal gives: A028310.
Lower diagonals include (offsets may differ): A002378, A045991, A085537, A085538, A085539.

Programs

  • Maple
    T:= (n, k)-> `if`(n=0 and k=0, 1, `if`(k<1 or k>n, 0,
                 `if`(k=n, n, (n-1)*n^(n-k)))):
    seq(seq(T(n,k), k=0..n), n=0..12);
  • Mathematica
    f[0,0]=1;
    f[n_,k_]:=Which[1<=k<=n-1,n^(n-k)*(n-1),k<1,0,k==n,n,k>n,0];
    Table[Table[f[n,k],{k,0,n}],{n,0,10}]//Grid (* Geoffrey Critzer, May 19 2014 *)

Formula

T(0,0) = 1, else T(n,k) = 0 for k<1 or k>n, else T(n,n) = n, else T(n,k) = (n-1)*n^(n-k).
Sum_{k=0..n} T(n,k) = A000312(n).
Sum_{k=0..n} k*T(n,k) = A031972(n).

A228154 T(n,k) is the number of s in {1,...,n}^n having longest contiguous subsequence with the same value of length k; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 2, 2, 12, 12, 3, 108, 120, 24, 4, 1280, 1520, 280, 40, 5, 18750, 23400, 3930, 510, 60, 6, 326592, 423360, 65016, 7644, 840, 84, 7, 6588344, 8800008, 1241464, 132552, 13440, 1288, 112, 8, 150994944, 206622720, 26911296, 2622528, 244944, 22032, 1872, 144, 9
Offset: 1

Views

Author

Walt Rorie-Baety, Aug 15 2013

Keywords

Examples

			T(1,1) =  1: [1].
T(2,1) =  2: [1,2], [2,1].
T(2,2) =  2: [1,1], [2,2].
T(3,1) = 12: [1,2,1], [1,2,3], [1,3,1], [1,3,2], [2,1,2], [2,1,3], [2,3,1], [2,3,2], [3,1,2], [3,1,3], [3,2,1], [3,2,3].
T(3,2) = 12: [1,1,2], [1,1,3], [1,2,2], [1,3,3], [2,1,1], [2,2,1], [2,2,3], [2,3,3], [3,1,1], [3,2,2], [3,3,1], [3,3,2].
T(3,3) =  3: [1,1,1], [2,2,2], [3,3,3].
Triangle T(n,k) begins:
.       1;
.       2,       2;
.      12,      12,       3;
.     108,     120,      24,      4;
.    1280,    1520,     280,     40,     5;
.   18750,   23400,    3930,    510,    60,    6;
.  326592,  423360,   65016,   7644,   840,   84,   7;
. 6588344, 8800008, 1241464, 132552, 13440, 1288, 112,  8;
		

Crossrefs

Row sums give: A000312.
Column k=1 gives: A055897.
Main diagonal gives: A000027.
Lower diagonal gives: 2*A180291.

Programs

  • Maple
    T:= proc(n) option remember; local b; b:=
          proc(m, s, i) option remember; `if`(m>i or s>m, 0,
            `if`(i=1, n, `if`(s=1, (n-1)*add(b(m, h, i-1), h=1..m),
             b(m, s-1, i-1) +`if`(s=m, b(m-1, s-1, i-1), 0))))
          end; forget(b);
          seq(add(b(k, s, n), s=1..k), k=1..n)
        end:
    seq(T(n), n=1..12);  # Alois P. Heinz, Aug 18 2013
  • Mathematica
    T[n_] := T[n] = Module[{b}, b[m_, s_, i_] := b[m, s, i] = If[m>i || s>m, 0, If[i == 1, n, If[s == 1, (n-1)*Sum[b[m, h, i-1], {h, 1, m}], b[m, s-1, i-1] + If[s == m, b[m-1, s-1, i-1], 0]]]]; Table[Sum[b[k, s, n], {s, 1, k}], {k, 1, n}]]; Table[ T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Mar 06 2015, after Alois P. Heinz *)

Formula

Sum_{k=1..n} k * T(n,k) = A228194(n). - Alois P. Heinz, Dec 23 2020

A228618 Sum of lengths of shortest runs with the same value over all s in {1,...,n}^n.

Original entry on oeis.org

0, 1, 6, 33, 280, 3185, 46956, 824593, 16782872, 387446193, 10000154620, 285312472621, 8916105651300, 302875136889793, 11112007033351602, 437893891702463085, 18446744083262649616, 827240261951698484129, 39346408075791905146044, 1978419655663922695962061
Offset: 0

Views

Author

Alois P. Heinz, Aug 27 2013

Keywords

Examples

			a(3) = 33 = 3 + 12*1 + 3 + 12*1 + 3: [1,1,1], [1,1,2], [1,1,3], [1,2,1], [1,2,2], [1,2,3], [1,3,1], [1,3,2], [1,3,3], [2,1,1], [2,1,2], [2,1,3], [2,2,1], [2,2,2], [2,2,3], [2,3,1], [2,3,2], [2,3,3], [3,1,1], [3,1,2], [3,1,3], [3,2,1], [3,2,2], [3,2,3], [3,3,1], [3,3,2], [3,3,3].
		

Crossrefs

Cf. A228194.

Formula

a(n) = Sum_{k=0..n} k*A228617(n,k).
a(n) ~ n^n. - Vaclav Kotesovec, Sep 06 2014

A228619 Number of s in {1,...,n}^n having shortest run with the same value of length one.

Original entry on oeis.org

0, 1, 2, 24, 240, 3080, 46410, 822612, 16771832, 387395856, 9999848700, 285310876620, 8916095279388, 302875076421528, 11112006618140610, 437893889060776260, 18446744064162650880, 827240261820996258848, 39346408074801256997526, 1978419655656704853586044
Offset: 0

Views

Author

Alois P. Heinz, Aug 27 2013

Keywords

Examples

			a(1) = 1: [1].
a(2) = 2: [1,2], [2,1].
a(3) = 24: [1,1,2], [1,1,3], [1,2,1], [1,2,2], [1,2,3], [1,3,1], [1,3,2], [1,3,3], [2,1,1], [2,1,2], [2,1,3], [2,2,1], [2,2,3], [2,3,1], [2,3,2], [2,3,3], [3,1,1], [3,1,2], [3,1,3], [3,2,1], [3,2,2], [3,2,3], [3,3,1], [3,3,2].
		

Crossrefs

Column k=1 of A228617.

Formula

a(n) ~ n^n. - Vaclav Kotesovec, Aug 29 2014

A228621 Number of s in {1,...,n}^n having shortest run with the same value of length 2.

Original entry on oeis.org

2, 0, 12, 40, 210, 840, 5208, 23760, 148410, 786720, 5137440, 30051528, 207058488, 1318599240, 9540828480, 65319695136, 495194683680, 3608366801040, 28572937581140, 219952629498840, 1813839842408748, 14663194937503288, 125593649761912704, 1061139859894326000
Offset: 2

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Examples

			a(2) = 2: [1,1], [2,2].
a(4) = 12: [1,1,2,2], [1,1,3,3], [1,1,4,4], [2,2,1,1], [2,2,3,3], [2,2,4,4], [3,3,1,1], [3,3,2,2], [3,3,4,4], [4,4,1,1], [4,4,2,2], [4,4,3,3].
		

Crossrefs

Column k=2 of A228617.

A228622 Number of s in {1,...,n}^n having shortest run with the same value of length 3.

Original entry on oeis.org

3, 0, 0, 30, 84, 112, 720, 2610, 6820, 29304, 112632, 343434, 1452780, 5962080, 20437536, 84860838, 366294996, 1383836500, 5823855240, 25918399122, 105425762860, 455785055328, 2084426266800, 8978844486300, 40011097380228, 187614063121716, 846902215710488
Offset: 3

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Examples

			a(3) = 3: [1,1,1], [2,2,2], [3,3,3].
a(6) = 2*C(6,2) = 30: [1,1,1,2,2,2], ..., [6,6,6,5,5,5].
		

Crossrefs

Column k=3 of A228617.

A228630 Number of s in {1,...,n}^n having shortest run with the same value of length 4.

Original entry on oeis.org

4, 0, 0, 0, 56, 144, 180, 220, 1716, 5928, 14560, 26880, 97680, 344352, 978588, 2346120, 7444580, 25763640, 79547622, 213434848, 663024312, 2288434800, 7496808800, 21967834824, 68476484916, 235311849416, 802176548700, 2519791766160, 8048777883936
Offset: 4

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Examples

			a(4) = 4: [1,1,1,1], [2,2,2,2], [3,3,3,3], [4,4,4,4].
a(8) = 2*C(8,2) = 56: [1,1,1,1,2,2,2,2], ..., [8,8,8,8,7,7,7,7].
		

Crossrefs

Column k=4 of A228617.

A228631 Number of s in {1,...,n}^n having shortest run with the same value of length 5.

Original entry on oeis.org

5, 0, 0, 0, 0, 90, 220, 264, 312, 364, 3360, 11280, 26656, 47430, 74556, 246240, 824040, 2242086, 5166260, 10272168, 26698800, 81381300, 233188956, 593255880, 1353111928, 3416572650, 9872919060, 28825911968, 78295457856, 194146795920, 496358103500
Offset: 5

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Examples

			a(5) = 5: [1,1,1,1,1], [2,2,2,2,2], [3,3,3,3,3], [4,4,4,4,4], [5,5,5,5,5].
a(10) = 2*C(10,2) = 90: [1,1,1,1,1,2,2,2,2,2], ..., [10,10,10,10,10,9,9,9,9,9].
		

Crossrefs

Column k=5 of A228617.

A228632 Number of s in {1,...,n}^n having shortest run with the same value of length 6.

Original entry on oeis.org

6, 0, 0, 0, 0, 0, 132, 312, 364, 420, 480, 544, 5814, 19152, 44080, 76440, 117348, 167992, 521640, 1686000, 4453800, 9985248, 19352088, 33855528, 76272030, 210339960, 568514208, 1389968448, 3071086788, 6184192000, 13415398920, 33589083960, 88858312814
Offset: 6

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Examples

			a(6) = 6: [1,1,1,1,1,1], [2,2,2,2,2,2], [3,3,3,3,3,3], [4,4,4,4,4,4],[5,5,5,5,5,5], [6,6,6,6,6,6].
a(12) = 2*C(12,2) = 132.
		

Crossrefs

Column k=6 of A228617.

A228633 Number of s in {1,...,n}^n having shortest run with the same value of length 7.

Original entry on oeis.org

7, 0, 0, 0, 0, 0, 0, 182, 420, 480, 544, 612, 684, 760, 9240, 30030, 67804, 115368, 174000, 245050, 329940, 981288, 3093720, 7999650, 17578860, 33429408, 57448512, 91863750, 186037460, 472754520, 1217599848, 2884102492, 6217627260, 12258776400, 22412899280
Offset: 7

Views

Author

Alois P. Heinz, Aug 28 2013

Keywords

Crossrefs

Column k=7 of A228617.
Showing 1-10 of 13 results. Next