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.

User: Dennis P. Walsh

Dennis P. Walsh's wiki page.

Dennis P. Walsh has authored 24 sequences. Here are the ten most recent ones:

A335109 Triangle read by rows: T(n,k) is the number of permutations of length n with each cycle of the permutation containing only elements that are identical (mod k), where 1 <= k <= n.

Original entry on oeis.org

1, 2, 1, 6, 2, 1, 24, 4, 2, 1, 120, 12, 4, 2, 1, 720, 36, 8, 4, 2, 1, 5040, 144, 24, 8, 4, 2, 1, 40320, 576, 72, 16, 8, 4, 2, 1, 362880, 2880, 216, 48, 16, 8, 4, 2, 1, 3628800, 14400, 864, 144, 32, 16, 8, 4, 2, 1
Offset: 1

Author

Dennis P. Walsh, May 23 2020

Keywords

Comments

Let [n] denote {1,2,...,n} and let [n](j,k) denote the subset of [n] consisting of all elements of [n] that equal j mod k. The cardinality of [n](j,k) equals ceiling(n/k) for j = 1..(n mod k) and equals floor(n/k) for j > (n mod k). Therefore, upon permuting the elements of each [n](j,k) subset, we obtain T(n,k) = (ceiling(n/k)!)^(n mod k)*(floor(n/k)!)^(k-(n mod k)).

Examples

			Triangle begins:
    1;
    2  1;
    6  2 1;
   24  4 2 1;
  120 12 4 2 1;
  ...
T(6,3) counts the 8 permutations of [6] where all cycle-mates are identical mod 3, namely, (1 4)(2 5)(3 6), (1 4)(2 5)(3)(6), (1 4)(2)(5)(3 6), (1)(4)(2 5)(3 6), (1 4)(2)(5)(3)(6), (1)(4)(2 5)(3)(6), (1)(4)(2)(5)(3 6) and (1)(2)(3)(4)(5)(6).
		

Crossrefs

Programs

  • Maple
    seq(seq((ceil(n/k)!)^(n mod k)*(floor(n/k)!)^(k-(n mod k)), k=1..n), n=1..10);
  • Mathematica
    Table[(Ceiling[n/k]!)^Mod[n, k]*(Floor[n/k]!)^(k - Mod[n, k]), {n, 10}, {k, n}] // Flatten (* Michael De Vlieger, Jun 28 2020 *)

Formula

T(n,k) = (ceiling(n/k)!)^(n mod k)*(floor(n/k)!)^(k-(n mod k)) for 1 <= k <= n.
T(n,1) = A000142(n).
T(n,2) = A010551(n) for n > 1.
T(n,3) = A264557(n) for n > 2.
T(n,4) = A264635(n) for n > 3.
T(n,5) = A264656(n) for n > 4.
T(n,k) = Product_{i=0..k-1} floor((n+i)/k)!. - Alois P. Heinz, May 23 2020

A335259 Triangle read by rows: T(n,k) = k^ceiling(n/k) for 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 1, 4, 9, 4, 1, 8, 9, 16, 5, 1, 8, 9, 16, 25, 6, 1, 16, 27, 16, 25, 36, 7, 1, 16, 27, 16, 25, 36, 49, 8, 1, 32, 27, 64, 25, 36, 49, 64, 9, 1, 32, 81, 64, 25, 36, 49, 64, 81, 10, 1, 64, 81, 64, 125, 36, 49, 64, 81, 100, 11, 1, 64, 81, 64, 125, 36, 49, 64, 81, 100, 121, 12
Offset: 1

Author

Dennis P. Walsh, May 28 2020

Keywords

Comments

T(n,k) is the number of functions f:[n]->[k] such that f(x)=f(y) whenever i*k-k+1<=x<=y<=i*k where 1<=i<=ceiling(n/k). An example of such a function is f:[8]->[3] defined by f(1)=f(2)=f(3)=2, f(4)=f(5)=f(6)=3, and f(7)=f(8)=2. To count all functions of this type when n=8 and k=3, we note that there are 3 possible values for f(1), f(4), and f(7). Hence T(8,3)=3^3 or, equivalently, 3^ceiling(8/3). A proof of the general result follows the same approach. We also note the following: (i) T(n,1)=1 for all n; (ii) T(n,n)=n for all n; T(n,k)=k^2 when ceiling(n/2)<=k

Examples

			Triangle T(n,k):
  1;
  1,  2;
  1,  4,  3;
  1,  4,  9,  4;
  1,  8,  9, 16,  5;
  1,  8,  9, 16, 25,  6;
  1, 16, 27, 16, 25, 36,  7;
  1, 16, 27, 16, 25, 36, 49,  8;
  1, 32, 27, 64, 25, 36, 49, 64,  9;
  1, 32, 81, 64, 25, 36, 49, 64, 81, 10;
...
T(8,3) counts the 27 functions from [8] to [3] where f(1)=f(2)=f(3), f(4)=f(5)=f(6), and f(7)=f(8). Letting f be defined by its vector of images <f(1), ...,f(8)>, the 27 functions are <1,1,1,1,1,1,1,1>, <1,1,1,1,1,1,2,2>, <1,1,1,1,1,1,3,3>, <1,1,1,2,2,2,1,1>, <1,1,1,2,2,2,2,2>, <1,1,1,2,2,2,3,3>, <1,1,1,3,3,3,1,1>, <1,1,1,3,3,3,2,2>, <1,1,1,3,3,3,3,3>, <2,2,2,1,1,1,1,1>, <2,2,2,1,1,1,2,2>, <2,2,2,1,1,1,3,3>, <2,2,2,2,2,2,1,1>, <2,2,2,2,2,2,2,2>, <2,2,2,2,2,2,3,3>, <2,2,2,3,3,3,1,1>, <2,2,2,3,3,3,2,2>, <2,2,2,3,3,3,3,3>, <3,3,3,1,1,1,1,1>, <3,3,3,1,1,1,2,2>, <3,3,3,1,1,1,3,3>, <3,3,3,2,2,2,1,1>, <3,3,3,2,2,2,2,2>, <3,3,3,2,2,2,3,3>, <3,3,3,3,3,3,1,1>, <3,3,3,3,3,3,2,2>, and <3,3,3,3,3,3,3,3>.
		

Crossrefs

Programs

  • Maple
    seq(seq(k^ceil(n/k),k=1..n),n=1..20);
  • Mathematica
    Table[k^Ceiling[n/k], {n, 12}, {k, n}] // Flatten (* Michael De Vlieger, Jun 28 2020 *)

Formula

G.f. for fixed k: k*x^k*(1+k*x+k*x^2+...+k*x^(k-1))/(1-k*x^k).
For n>1, T(n,2) = A016116(n).
For n>2, T(n,3) = A127975(n).

A293211 Triangle T(n,k) is the number of permutations on n elements with at least one k-cycle for 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 4, 3, 2, 15, 9, 8, 6, 76, 45, 40, 30, 24, 455, 285, 200, 180, 144, 120, 3186, 1995, 1400, 1260, 1008, 840, 720, 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040, 229384, 142695, 103040, 79380, 72576, 60480, 51840, 45360, 40320, 2293839, 1427895, 1030400, 793800, 653184, 604800, 518400, 453600, 403200, 362880
Offset: 1

Author

Dennis P. Walsh, Oct 02 2017

Keywords

Comments

T(n,k) is equivalent to n! minus the number of permutations on n elements with zero k-cycles (sequence A122974).

Examples

			T(n,k) (the first 8 rows):
:     1;
:     1,     1;
:     4,     3,     2;
:    15,     9,     8,    6;
:    76,    45,    40,   30,   24;
:   455,   285,   200,  180,  144,  120;
:  3186,  1995,  1400, 1260, 1008,  840,  720;
: 25487, 15855, 11200, 8820, 8064, 6720, 5760, 5040;
  ...
T(4,3)=8 since there are exactly 8 permutations on {1,2,3,4} with at least one 3-cycle: (1)(234), (1)(243), (2)(134), (2)(143), (3)(124), (3)(142), (4)(123), and (4)(132).
		

Crossrefs

Row sums give A132961.
T(n,n) gives A000142(n-1) for n>0.
T(2n,n) gives A052145.

Programs

  • Maple
    T:=(n,k)->n!*sum((-1)^(j+1)*(1/k)^j/j!,j=1..floor(n/k)); seq(seq(T(n,k),k=1..n),n=1..10);
  • Mathematica
    Table[n!*Sum[(-1)^(j + 1)*(1/k)^j/j!, {j, Floor[n/k]}], {n, 10}, {k, n}] // Flatten (* Michael De Vlieger, Oct 02 2017 *)

Formula

T(n,k) = n! * Sum_{j=1..floor(n/k)} (-1)^(j+1)*(1/k)^j/j!.
T(n,k) = n! - A122974(n,k).
E.g.f. of column k: (1-exp(-x^k/k))/(1-x). - Alois P. Heinz, Oct 11 2017

A243987 Triangle read by rows: T(n, k) is the number of divisors of n that are less than or equal to k for 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 2, 3, 1, 1, 1, 1, 2, 1, 2, 3, 3, 3, 4, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 3, 3, 3, 3, 4, 1, 1, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
Offset: 1

Author

Dennis P. Walsh, Jun 16 2014

Keywords

Comments

This triangular sequence T(n,k) generalizes sequence A000005, the number of divisors of n; in particular, A000005(n) = T(n,n).
Also, for prime p, T(p,k) = 1 when k < p and T(p,p) = 2.

Examples

			T(6,4)=3 since there are 3 divisors of 6 that are less than or equal to 4, namely, 1, 2 and 3.
T(n,k) as a triangle, n=1..15:
1,
1, 2,
1, 1, 2,
1, 2, 2, 3,
1, 1, 1, 1, 2,
1, 2, 3, 3, 3, 4,
1, 1, 1, 1, 1, 1, 2,
1, 2, 2, 3, 3, 3, 3, 4,
1, 1, 2, 2, 2, 2, 2, 2, 3,
1, 2, 2, 2, 3, 3, 3, 3, 3, 4
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
		

Crossrefs

Cf. A000005 (diagonal), A000012 (first column), A081307 (row sums), A027750 (divisors of n).

Programs

  • Haskell
    a243987 n k = a243987_tabl !! (n-1) !! (k-1)
    a243987_row n = a243987_tabl !! (n-1)
    a243987_tabl = map (scanl1 (+)) a051731_tabl
    -- Reinhard Zumkeller, Apr 22 2015
  • Maple
    T:=(n,k)->1/n!*eval(diff(sum(x^j/(1-x^j),j=1..k),x$n),x=0):
    seq(seq(T(n,k), k=1..n), n=1..10);
    # Alternative:
    IversonBrackets := expr -> subs(true=1, false=0, evalb(expr)):
    T := (n, k) -> add(IversonBrackets(irem(n, j) = 0), j = 1..k):
    for n from 1 to 19 do seq(T(n, k), k = 1..n) od; # Peter Luschny, Jan 02 2021
  • PARI
    T(n, k) = sumdiv(n, d, d<=k); \\ Michel Marcus, Jun 17 2014
    

Formula

T(n,1) = 1; T(n,n) = A000005(n).
T(n,k) = coefficient of the x^n term in the expansion of Sum(x^j/(1-x^j), j=1..k).
T(n,k) = Sum_{j=1..k} A051731(n,j). - Reinhard Zumkeller, Apr 22 2015

A224711 Number of ballot results from n voters that prompt a run-off election when three candidates vie for two spots on a board.

Original entry on oeis.org

1, 0, 6, 6, 18, 90, 150, 420, 1890, 3570, 10206, 42966, 87318, 252252, 1019304, 2172456, 6319170, 24810786, 54712086, 159906318, 614406078, 1390381278, 4077926034, 15403838346, 35579546262, 104633453340, 389788932240, 915500037120, 2698033909680, 9934966920960
Offset: 0

Author

Dennis P. Walsh, Apr 29 2013

Keywords

Comments

We assume each of n voters cast two votes, one each for two of three candidates. A run-off election is necessitated if all 3 candidates receive the same number of votes or if there is a tie for the second to most votes. The total number of ballot results is 3^n since each voter must choose two of three candidates. The number of ballot results that necessitate a run-off election is derived in the note "The probability of a run-off election.." cited in the link section below.
The sequence A103221 is used in the derivation. Note that we assign the value 1 to a(0) because if no voters cast ballots on election day another election is needed.

Examples

			For n=3, a(3)=6 since a three voter election has 6 possible ballot results that necessitate a run-off. Let A, B, and C denote the three candidates, and, for example, let [AB|AC|BC] denote a ballot result in which voter 1 votes for candidates A and B, voter 2 votes for candidates A and C, and voter 3 votes for candidates B and C. The 6 ballot results that necessitate a run-off election are then given by [AB|AC|BC], [AB|BC|AC], [AC|AB|BC], [AC|BC|AB], [BC|AB|AC], and [BC|AC|AB].
		

Programs

  • Maple
    ind:= n-> piecewise(n mod 3=0, 1, 0):
    u:= n-> floor(n/2+1)-floor(n/3+2/3)-1:
    a:= n-> 3*add(binomial(n, 2*ceil((n-1)/2)-2*k)*
            binomial(2*ceil((n-1)/2)-2*k, ceil((n-1)/2)-k), k=0..u(n))
            -ind(n)*2*binomial(n, 2*n/3)*binomial(2*n/3, n/3):
    seq(a(n), n=0..30);

Formula

a(n) = 3*sum(C(n,2*b(k)) *C(2*b(k),b(k)), k=0..u(n)) -2*C(n,2n/3) * C(2n/3,n/3) I[3|n] where b(k) = ceiling((n-1)/2)-k, u(n) = floor((n+2)/2) - floor((n+2)/3)-1 = A103221(n)-1, and I[statement] equals 1 if the statement is true and equals 0 otherwise.

A224542 Number of doubly-surjective functions f:[n]->[4].

Original entry on oeis.org

2520, 30240, 226800, 1367520, 7271880, 35692800, 165957792, 742822080, 3234711480, 13803744864, 58021888080, 241116750624, 993313349544, 4064913201216, 16549636147968, 67112688842496, 271323921459096, 1094303232174240, 4405390451382960, 17709538489849440
Offset: 8

Author

Dennis P. Walsh, Apr 09 2013

Keywords

Comments

Fourth column of A200091: A200091(n,4)=a(n).
Also, a(n) is (i) the number of length-n words on the alphabet A, B, C, and D with each letter of the alphabet occurring at least twice; (ii) the number of ways to distribute n different toys to 4 children so that each child gets at least two toys; (iii) the number of ways to put n numbered balls into 4 labeled boxes so that each box gets at least two balls; (iv) the number of n-digit positive integers consisting of only digits 1,2,3, and 4 with each of these digits appearing at least twice.
A doubly-surjective function f:D->C is such that the pre-image set f^-1(y) has size at least 2 for each y in C.
Triangle A200091 provides the number of doubly-surjective functions f from a set of size n onto a set of size k. Hence a(n) is column 4 of A200091.

Examples

			a(9) = 30240 since there are 30240 ways to distribute 9 different toys to 4 children so that each child gets at least 2 toys. One child must get 3 toys and the other children get 2 toys each. There are 4 ways to pick the lucky kid. There are C(9,3) ways to choose the 3 toys for the lucky kid. There are 6!/(2!)^3 ways to distribute the remaining 6 toys among the 3 kids. We obtain 4*C(9,3)*6!/8=30240.
		

Crossrefs

Programs

  • Maple
    seq(eval(diff((exp(x)-x-1)^4,x$n),x=0),n=8..40);
  • Mathematica
    nn=27; Drop[Range[0,nn]! CoefficientList[Series[(Exp[x]-x-1)^4, {x,0,nn}], x], 8] (* Geoffrey Critzer, Sep 28 2013 *)
  • PARI
    my(x='x+O('x^66)); Vec(serlaplace((exp(x)-x-1)^4)) /* Joerg Arndt, Apr 10 2013 */

Formula

a(n) = 4^n-4*3^n-4*n*3^(n-1)+(9*n+3*n^2)*2^(n-1)+6*2^n-4-8*n-4*n^3;
a(n) = sum(n!/(i!*j!*k!*m!)) over such that i,j,k, and m are all at least 2 and i+j+k+m=n.
E.g.f.: (exp(x)-x-1)^4.
a(n) = 24*A058844(n). - Alois P. Heinz, Apr 10 2013
G.f.: 24*x^8*(288*x^6-1560*x^5+3500*x^4-4130*x^3+2625*x^2-840*x+105) / ((x-1)^4*(2*x-1)^3*(3*x-1)^2*(4*x-1)). - Colin Barker, Jun 04 2013

A224541 Number of doubly-surjective functions f:[n]->[3].

Original entry on oeis.org

90, 630, 2940, 11508, 40950, 137610, 445896, 1410552, 4390386, 13514046, 41278068, 125405532, 379557198, 1145747538, 3452182656, 10388002848, 31230066186, 93828607686, 281775226860, 845929656900, 2539047258150, 7619759016090, 22864712861880, 68605412870088
Offset: 6

Author

Dennis P. Walsh, Apr 09 2013

Keywords

Comments

Third column of A200091.
Also, a(n) is (i) the number of length-n words on the alphabet A, B, and C with each letter occurring at least twice; (ii) the number of ways to distribute n different toys to 3 different children so that each child gets at least 2 toys; (iii) the number of ways to put n numbered balls into 3 labeled boxes so that each box gets at least 2 balls; (iv) the number of n-digit positive integers consisting only of the digits 1, 2, and 3 with each of these digits appearing at least twice. A doubly-surjective function f has size at least 2 for each pre-image set, that is, |f^-1(y)|>=2 for each element y of the codomain.[Note that a surjective function has |f^-1(y)|>=1.] The triangle A200091 provides the number of doubly-surjective functions f:[n]->[k]. Column 3 of triangle A200091 is a(n).
Sequence A052515 is the number of doubly-surjective functions f:[n]->[2] with exponential generating function (exp(x)-x-1)^2. In general, the number of doubly-surjective functions f:[n]->[k] has exponential generating function (exp(x)-x-1)^k.

Examples

			For n=6 we have a(6)=90 since there are 90 six-digit  positive integers using only digits 1, 2, and 3 with each of those digits appearing at least twice. The first 30 of the ninety, namely those with initial digit 1, are given below:
112233, 112323, 112332, 113223, 113232, 113322,
121233, 121323, 121332, 122133, 122313, 122331,
123123, 123132, 123213, 123231, 123312, 123321,
131223, 131232, 131322, 132123, 132132, 132213,
132231, 132312, 132321, 133122, 133212, 133221.
		

Crossrefs

Cf. A052515, the number of doubly-surjective functions f:[n]->[2].

Programs

  • Maple
    seq(3^n-3*2^n-3*n*2^(n-1)+3+3*n+3*n^2, n=6..40);
  • Mathematica
    With[{nn=40},Drop[CoefficientList[Series[(Exp[x]-x-1)^3,{x,0,nn}],x] Range[0,nn]!,6]] (* Harvey P. Dale, Oct 01 2015 *)
  • PARI
    x='x+O('x^66); Vec(serlaplace((exp(x)-x-1)^3)) \\ Joerg Arndt, Apr 10 2013

Formula

a(n) = 3^n-3*2^n-3*n*2^(n-1)+3+3*n+3*n^2.
E.g.f.: (exp(x)-x-1)^3.
From Alois P. Heinz, Apr 10 2013: (Start)
a(n) = 6*A000478(n).
G.f.: -6*(12*x^3-40*x^2+45*x-15)*x^6 / ((3*x-1)*(2*x-1)^2*(x-1)^3).
(End)

A218832 Number of positive integer solutions to the Diophantine equation x + y + 2z = n^2.

Original entry on oeis.org

0, 1, 12, 49, 132, 289, 552, 961, 1560, 2401, 3540, 5041, 6972, 9409, 12432, 16129, 20592, 25921, 32220, 39601, 48180, 58081, 69432, 82369, 97032, 113569, 132132, 152881, 175980, 201601, 229920, 261121, 295392, 332929, 373932, 418609, 467172, 519841, 576840, 638401
Offset: 1

Author

Dennis P. Walsh, Mar 27 2013

Keywords

Comments

The derivation for the number of integer solutions is given in a link below. It is straightforward and uses the fact that the number of positive integer solutions to x + y = n is given by n-1.

Examples

			For n=3, a(n)=12 since there are exactly 12 positive integer solutions (x,y,z) to x+y+2z=9, namely, (1,2,3),(1,4,2), (1,6,1), (2,1,3), (2,3,2), (2,5,1), (3,2,2),(3,4,1), (4,1,2), (4,3,1), (5,2,1), and (6,1,1).
		

Programs

  • Maple
    seq(floor(n^4/4-n^2+1),n=1..40);

Formula

a(n) = floor(n^4/4-n^2+1).
Conjectures from Colin Barker, Apr 01 2013: (Start)
a(n) = (7 + (-1)^n - 8*n^2 + 2*n^4)/8.
G.f.: -x^2*(x^4 - 4*x^3 + 6*x^2 + 8*x + 1) / ((x-1)^5*(x+1)). (End)

A182309 Triangle T(n,k) with 2 <= k <= floor(2(n+1)/3) gives the number of length-n binary sequences with exactly k zeros and with length two for the longest run of zeros.

Original entry on oeis.org

1, 2, 3, 2, 4, 6, 1, 5, 12, 6, 6, 20, 18, 3, 7, 30, 40, 16, 1, 8, 42, 75, 50, 10, 9, 56, 126, 120, 45, 4, 10, 72, 196, 245, 140, 30, 1, 11, 90, 288, 448, 350, 126, 15, 12, 110, 405, 756, 756, 392, 90, 5, 13, 132, 550, 1200, 1470, 1008, 357, 50, 1, 14, 156, 726
Offset: 2

Author

Dennis P. Walsh, Apr 23 2012

Keywords

Comments

Triangle T(n,k) captures several well known sequences. In particular, T(n,2)=(n-1), the natural numbers; T(n,3)=(n-2)(n-3)=A002378(n-3), the "oblong" numbers; T(n,4)=(n-3)(n-4)^2/2=A002411(n-4), "pentagonal pyramidal" numbers; and also T(n,5)=(n-4)C(n-4,3)=A004320(n-6). Furthermore, row sums=A000100(n+1).

Examples

			For n=6 and k=3, T(6,3)=12 since there are 12 binary sequences of length 6 that contain 3 zeros and that have a maximum run of zeros of length 2, namely, 011100, 101100, 110100, 011001, 101001, 110010, 010011, 100110, 100101, 001110, 001101, and 001011.
Triangle T(n,k) begins
   1,
   2,
   3,   2,
   4,   6,   1,
   5,  12,   6,
   6,  20,  18,    3,
   7,  30,  40,   16,    1,
   8,  42,  75,   50,   10,
   9,  56, 126,  120,   45,    4,
  10,  72, 196,  245,  140,   30,    1,
  11,  90, 288,  448,  350,  126,   15,
  12, 110, 405,  756,  756,  392,   90,    5,
  13, 132, 550, 1200, 1470, 1008,  357,   50,   1,
  14, 156, 726, 1815, 2640, 2268, 1106,  266,  21,
  15, 182, 936, 2640, 4455, 4620, 2898, 1016, 161, 6,
		

Crossrefs

Row sums of triangle T(n,k)=A000100(n+1);
T(n,3)=A002378(n-3); T(n,4)=A002411(n-4);
T(n,5)=A004320(n-6).

Programs

  • Maple
    seq(seq(sum(binomial(n-k+1,j)*binomial(n-k+1-j,k-2*j),j=1..floor(k/2)),k=2..floor(2*(n+1)/3)),n=2..20);
  • Mathematica
    t[n_, k_] := Sum[ Binomial[n-k+1, j]*Binomial[n-k-j+1, k-2*j], {j, 1, k/2}]; Table[t[n, k], {n, 2, 15}, {k, 2, 2*(n+1)/3}] // Flatten (* Jean-François Alcover, Jun 06 2013 *)

Formula

T(n,k) = Sum_{j=1..k/2} binomial(n-k+1,j)*binomial(n-k-j+1,k-2j) for 2 <= k <= 2(n+1)/3.

A182210 Triangle T(n,k) = floor(k*(n+1)/(k+1)), 1 <= k <= n.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 2, 3, 3, 4, 3, 4, 4, 4, 5, 3, 4, 5, 5, 5, 6, 4, 5, 6, 6, 6, 6, 7, 4, 6, 6, 7, 7, 7, 7, 8, 5, 6, 7, 8, 8, 8, 8, 8, 9, 5, 7, 8, 8, 9, 9, 9, 9, 9, 10, 6, 8, 9, 9, 10, 10, 10, 10, 10, 10, 11, 6, 8, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 7, 9, 10, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 7, 10, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 8, 10, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15
Offset: 1

Author

Dennis P. Walsh, Apr 18 2012

Comments

T(n,k) is the maximum number of wins in a sequence of n games in which the longest winning streak is of length k.
T(n,k) generalizes the pattern found in sequence A004523 where A004523(n) = floor(2n/3).

Examples

			T(12,4) = 10 since 10 is the maximum number of wins in a 12-game sequence in which the longest winning streak is 4. One such sequence with 10 wins is WWWWLWWWWLWW.
The triangle T(n,k) begins
1,
1, 2,
2, 2, 3,
2, 3, 3,  4,
3, 4, 4,  4,  5,
3, 4, 5,  5,  5,  6,
4, 5, 6,  6,  6,  6,  7,
4, 6, 6,  7,  7,  7,  7,  8,
5, 6, 7,  8,  8,  8,  8,  8,  9,
5, 7, 8,  8,  9,  9,  9,  9,  9, 10,
6, 8, 9,  9, 10, 10, 10, 10, 10, 10, 11,
6, 8, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12,
		

Crossrefs

A004523(n+1) = T(n,2).

Programs

  • Haskell
    a182210 n k = a182210_tabl !! (n-1) !! (k-1)
    a182210_tabl = [[k*(n+1) `div` (k+1) | k <- [1..n]] | n <- [1..]]
    -- Reinhard Zumkeller, Jul 08 2012
  • Maple
    seq(seq(floor(k*(n+1)/(k+1)),k=1..n),n=1..15);
  • Mathematica
    Flatten[Table[Floor[k*(n+1)/(k+1)],{n,0,20},{k,n}]] (* Harvey P. Dale, Jul 21 2015 *)

Formula

T(n,k) = floor(k(n+1)/(k+1)).