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-4 of 4 results.

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).

A085388 First differences of n^k.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 2, 0, 1, 3, 6, 4, 0, 1, 4, 12, 18, 8, 0, 1, 5, 20, 48, 54, 16, 0, 1, 6, 30, 100, 192, 162, 32, 0, 1, 7, 42, 180, 500, 768, 486, 64, 0, 1, 8, 56, 294, 1080, 2500, 3072, 1458, 128, 0, 1, 9, 72, 448, 2058, 6480, 12500, 12288, 4374, 256, 0, 1, 10, 90, 648
Offset: 1

Views

Author

Paul Barry, Jun 30 2003

Keywords

Comments

T(n,k) is the number of k-digit numbers in base n; n,k >= 2. - Mohammed Yaseen, Nov 11 2022

Examples

			Rows begin
  1,   0,   0,   0,   0, ...
  1,   1,   2,   4,   8, ...
  1,   2,   6,  18,  54, ...
  1,   3,  12,  48, 192, ...
  1,   4,  20, 100, 500, ...
		

Crossrefs

Diagonals include A053506, A085389, A085390.
Row-wise binomial transform is A083064.

Formula

T(n,k) = (n-1)*n^(k-1) + 0^k/n. - Corrected by Mohammed Yaseen, Nov 11 2022
T(n,0) = 1; T(n,k) = n^k - n^(k-1) for k >= 1. - Mohammed Yaseen, Nov 11 2022

Extensions

Offset corrected by Mohammed Yaseen, Nov 11 2022

A085390 a(n) = (n(n+1)^(n-2)+0^(n-2))/(n+1).

Original entry on oeis.org

1, 3, 20, 180, 2058, 28672, 472392, 9000000, 194871710, 4729798656, 127253992476, 3760310514688, 121096582031250, 4222124650659840, 158473248526494992, 6371827248895377408, 273260286537746369382, 12451840000000000000000
Offset: 2

Views

Author

Paul Barry, Jun 30 2003

Keywords

Comments

A diagonal of square array A085388.

Crossrefs

A386015 Number of parking functions of size n with a descent in the first position.

Original entry on oeis.org

0, 1, 6, 50, 540, 7203, 114688, 2125764, 45000000, 1071794405, 28378791936, 827150951094, 26322173602816, 908224365234375, 33776997205278720, 1347022612475207432, 57346445240058396672, 2595972722108590509129, 124518400000000000000000, 6308807923967155297895610, 336682260736692839281065984
Offset: 1

Views

Author

Gabe Udell, Jul 14 2025

Keywords

Examples

			For n=1 the only parking function is 1 and it does not have a descent in the first position so a(1)=0.
For n=2 there are 3 parking functions: 11,12,21. Among them only 21 has a descent in the first position so a(2)=1.
For n=3 there are 16 parking functions: 111,112,121,211,122,212,221,113,131,311,123,132,213,231,312,321. Of these, 211,212,311,213,312, and 321 have a descent in the first position so a(3)=6.
		

Crossrefs

Programs

Formula

a(n) = (n/2)*(n+1)^(n-2) for n >= 2.
a(n) = A085389(n) / 2 for n >= 2.
Showing 1-4 of 4 results.