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

A166240 Triangle read by rows, A000012 * A152140 as infinite lower triangular matrices.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 3, 4, 2, 2, 1, 1, 1, 4, 4, 4, 2, 2, 1, 1, 1, 1, 4, 6, 4, 4, 2, 2, 1, 1, 1, 5, 6, 7, 4, 4, 2, 2, 1, 1, 1, 5, 9, 7, 7, 4, 4, 2, 2, 1, 1, 1, 6, 9, 11, 7, 7, 4, 4, 2, 2, 1, 1
Offset: 1

Views

Author

Gary W. Adamson, Oct 09 2009

Keywords

Comments

Row sums = A036469, (partial sums of A000009).
The triangle = partial sums of A152140 starting from the top down, by columns.

Examples

			First few rows of the triangle =
1;
1, 1;
1, 1, 1;
1, 2, 1, 1;
1, 2, 2, 1, 1;
1, 3, 2, 2, 1, 1;
1, 3, 4, 2, 2, 1, 1;
1, 4, 4, 4, 2, 2, 1, 1;
1, 4, 6, 4, 4, 2, 2, 1, 1;
1, 5, 6, 7, 4, 4, 2, 2, 1, 1;
1, 5, 9, 7, 7, 4, 4, 2, 2, 1, 1;
1, 6, 9, 11, 7, 7, 4, 4, 2, 2, 1, 1;
1, 6, 12, 11, 12, 7, 7, 4, 4, 2, 2, 1, 1;
1, 7, 12, 16, 12, 12, 7, 7, 4, 4, 2, 2, 1, 1;
1, 7, 16, 16, 18, 12, 12, 7, 7, 4, 4, 2, 2, 1, 1;
1, 8, 16, 23, 18, 19, 12, 19, 7, 7, 4, 4, 2, 2, 1, 1;
...
		

Crossrefs

Formula

Triangle read by rows, A000012 * A152140, where A000012 = an infinite lower triangular matrix with all 1's: [1; 1,1; 1,1,1;...].

A116674 Triangle read by rows: T(n,k) is the number of partitions of n into odd parts and having exactly k distinct parts (n>=1, k>=1).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 3, 1, 5, 3, 4, 1, 2, 7, 1, 2, 8, 2, 2, 10, 3, 2, 11, 5, 2, 13, 7, 4, 12, 11, 1, 19, 11, 1, 2, 18, 17, 1, 3, 20, 21, 2, 2, 22, 27, 3, 2, 25, 32, 5, 4, 24, 41, 7, 2, 30, 46, 11, 2, 31, 56, 15, 2, 36, 62, 22, 3, 33, 80, 25, 1, 2, 39, 87, 36, 1, 4, 38, 103, 45, 2, 2, 45
Offset: 1

Views

Author

Emeric Deutsch, Feb 22 2006

Keywords

Comments

Row n has floor(sqrt(n)) terms. Row sums yield A000009. T(n,1)=A001227(n) (n>=1). Sum(k*T(n,k),k>=1)=A038348(n-1) (n>=1).
Conjecture: Also the number of strict integer partitions of n with k maximal runs of consecutive parts decreasing by 1. - Gus Wiseman, Jun 24 2025

Examples

			From _Gus Wiseman_, Jun 24 2025: (Start)
Triangle begins:
   1:  1
   2:  1
   3:  2
   4:  1  1
   5:  2  1
   6:  2  2
   7:  2  3
   8:  1  5
   9:  3  4  1
  10:  2  7  1
  11:  2  8  2
  12:  2 10  3
  13:  2 11  5
  14:  2 13  7
  15:  4 12 11
  16:  1 19 11  1
  17:  2 18 17  1
  18:  3 20 21  2
  19:  2 22 27  3
  20:  2 25 32  5
Row n = 9 counts the following partitions into odd parts by number of distinct parts:
  (9)                  (7,1,1)          (5,3,1)
  (3,3,3)              (3,3,1,1,1)
  (1,1,1,1,1,1,1,1,1)  (5,1,1,1,1)
                       (3,1,1,1,1,1,1)
Row n = 9 counts the following strict partitions by number of maximal runs:
  (9)      (6,3)    (5,3,1)
  (5,4)    (7,2)
  (4,3,2)  (8,1)
           (6,2,1)
(End)
		

Crossrefs

Row sums are A000009, strict case of A000041.
Row lengths are A000196.
Leading terms are A001227.
A007690 counts partitions with no singletons, complement A183558.
A034296 counts flat partitions, ranks A066311 or A073491.
A047993 counts partitions with max part = length.
A152140 counts partitions into odd parts by length.
A268193 counts partitions by number of maximal anti-runs, strict A384905.
A384881 counts partitions by number of maximal runs.

Programs

  • Maple
    g:=product(1+t*x^(2*j-1)/(1-x^(2*j-1)),j=1..35): gser:=simplify(series(g,x=0,34)): for n from 1 to 29 do P[n]:=coeff(gser,x^n) od: for n from 1 to 29 do seq(coeff(P[n],t,j),j=1..floor(sqrt(n))) od; # yields sequence in triangular form
    # second Maple program:
    with(numtheory):
    b:= proc(n, i) option remember; expand(`if`(n=0, 1,
          `if`(i<1, 0, add(b(n-i*j, i-2)*`if`(j=0, 1, x), j=0..n/i))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..degree(p)))(
             b(n, iquo(n+1, 2)*2-1)):
    seq(T(n), n=1..30);  # Alois P. Heinz, Mar 08 2015
  • Mathematica
    b[n_, i_] := b[n, i] = Expand[If[n == 0, 1, If[i<1, 0, Sum[b[n-i*j, i-2]*If[j == 0, 1, x], {j, 0, n/i}]]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 1, Exponent[p, x]}]][b[n, Quotient[n+1, 2]*2-1]]; Table[T[n], {n, 1, 30}] // Flatten (* Jean-François Alcover, May 22 2015, after Alois P. Heinz *)
    Table[Length[Select[IntegerPartitions[n],OddQ[Times@@#]&&Length[Union[#]]==k&]],{n,1,12},{k,1,Floor[Sqrt[n]]}] (*  Gus Wiseman, Jun 24 2025 *)

Formula

G.f.: product(1+tx^(2j-1)/(1-x^(2j-1)), j=1..infinity).

A152146 Triangle read by rows: T(n,k) (n >= 0, 0 <= k <= n) = number of partitions of 2n into 2k odd parts.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 2, 2, 1, 1, 0, 3, 3, 2, 1, 1, 0, 3, 5, 3, 2, 1, 1, 0, 4, 6, 5, 3, 2, 1, 1, 0, 4, 9, 7, 5, 3, 2, 1, 1, 0, 5, 11, 11, 7, 5, 3, 2, 1, 1, 0, 5, 15, 14, 11, 7, 5, 3, 2, 1, 1, 0, 6, 18, 20, 15, 11, 7, 5, 3, 2, 1, 1, 0, 6, 23, 26, 22, 15, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

R. J. Mathar, Sep 25 2009, indices corrected Jul 09 2012

Keywords

Comments

In both this and A152157, reading columns downwards "converges" to A000041.
Also the number of strict integer partitions of 2n with alternating sum 2k. Also the number of normal integer partitions of 2n of which 2k parts are odd, where a partition is normal if it covers an initial interval of positive integers. - Gus Wiseman, Jun 20 2021

Examples

			Triangle begins:
  1
  0  1
  0  1  1
  0  2  1   1
  0  2  2   1   1
  0  3  3   2   1   1
  0  3  5   3   2   1   1
  0  4  6   5   3   2   1  1
  0  4  9   7   5   3   2  1  1
  0  5 11  11   7   5   3  2  1  1
  0  5 15  14  11   7   5  3  2  1  1
  0  6 18  20  15  11   7  5  3  2  1  1
  0  6 23  26  22  15  11  7  5  3  2  1  1
  0  7 27  35  29  22  15 11  7  5  3  2  1  1
  0  7 34  44  40  30  22 15 11  7  5  3  2  1 1
  0  8 39  58  52  42  30 22 15 11  7  5  3  2 1 1
  0  8 47  71  70  55  42 30 22 15 11  7  5  3 2 1 1
  0  9 54  90  89  75  56 42 30 22 15 11  7  5 3 2 1 1
  0  9 64 110 116  97  77 56 42 30 22 15 11  7 5 3 2 1 1
  0 10 72 136 146 128 100 77 56 42 30 22 15 11 7 5 3 2 1 1
From _Gus Wiseman_, Jun 20 2021: (Start)
For example, row n = 6 counts the following partitions (B = 11):
  (75)  (3333)  (333111)  (33111111)  (3111111111)  (111111111111)
  (93)  (5331)  (531111)  (51111111)
  (B1)  (5511)  (711111)
        (7311)
        (9111)
The corresponding strict partitions are:
  (7,5)      (8,4)      (9,3)    (10,2)   (11,1)  (12)
  (6,5,1)    (5,4,3)    (7,3,2)  (9,2,1)
  (5,4,2,1)  (6,4,2)    (8,3,1)
             (7,4,1)
             (6,3,2,1)
The corresponding normal partitions are:
  43221    33321     3321111    321111111   21111111111  111111111111
  322221   332211    32211111   2211111111
  2222211  432111    222111111
           3222111
           22221111
(End)
		

Crossrefs

Cf. A035294 (row sums), A107379, A152140, A152157.
Column k = 1 is A004526.
Column k = 2-8 is A026810 - A026816.
The non-strict version is A239830.
The reverse non-strict version is A344610.
The reverse version is A344649
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A067659 counts strict partitions of odd length.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A124754 gives alternating sum of standard compositions (reverse: A344618).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A344611 counts partitions of 2n with reverse-alternating sum >= 0.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-2)+`if`(i>n, 0, expand(sqrt(x)*b(n-i, i)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(2*n, 2*n-1)):
    seq(T(n), n=0..12);  # Alois P. Heinz, Jun 21 2021
  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&ats[#]==k&]],{n,0,30,2},{k,0,n,2}] (* Gus Wiseman, Jun 20 2021 *)

Formula

T(n,k) = A152140(2n,2k).

A107379 Number of ways to write n^2 as the sum of n odd numbers, disregarding order.

Original entry on oeis.org

1, 1, 1, 3, 9, 30, 110, 436, 1801, 7657, 33401, 148847, 674585, 3100410, 14422567, 67792847, 321546251, 1537241148, 7400926549, 35854579015, 174677578889, 855312650751, 4207291811538, 20782253017825, 103048079556241, 512753419159803, 2559639388956793
Offset: 0

Views

Author

David Radcliffe, Sep 25 2009

Keywords

Comments

Motivated by the fact that the n-th square is equal to the sum of the first n odd numbers.
Also the number of partitions of n^2 into n distinct parts. a(3) = 3: [1,2,6], [1,3,5], [2,3,4]. - Alois P. Heinz, Jan 20 2011
Also the number of partitions of n*(n-1)/2 into parts not greater than n. - Paul D. Hanna, Feb 05 2012
Also the number of partitions of n*(n+1)/2 into n parts. - J. Stauduhar, Sep 05 2017
Also the number of fair dice with n sides and expected value (n+1)/2 with distinct composition of positive integers. - Felix Huber, Aug 11 2024

Examples

			For example, 9 can be written as a sum of three odd numbers in 3 ways: 1+1+7, 1+3+5 and 3+3+3.
		

Crossrefs

Programs

  • Maple
    f := proc (n, k) option remember;
    if n = 0 and k = 0 then return 1 end if;
    if n <= 0 or n < k then return 0 end if;
    if `mod`(n+k, 2) = 1 then return 0 end if;
    if k = 1 then return 1 end if;
    return procname(n-1, k-1) + procname(n-2*k, k)
    end proc;
    seq(f(k^2,k), k=0..20);
  • Mathematica
    Table[SeriesCoefficient[Product[1/(1-x^k),{k,1,n}],{x,0,n*(n-1)/2}],{n,0,20}] (* Vaclav Kotesovec, May 25 2015 *)
  • PARI
    {a(n)=polcoeff(prod(k=1,n,1/(1-x^k+x*O(x^(n*(n-1)/2)))),n*(n-1)/2)} /* Paul D. Hanna, Feb 05 2012 */

Formula

a(n) = A008284((n^2+n)/2,n) = A008284(A000217(n),n). - Max Alekseyev, Sep 25 2009
a(n) = [x^(n*(n-1)/2)] Product_{k=1..n} 1/(1 - x^k). - Paul D. Hanna, Feb 05 2012
a(n) ~ c * d^n / n^2, where d = 5.400871904118154152466091119104270052029... = A258234, c = 0.155212227152682180502977404265024265... . - Vaclav Kotesovec, Sep 07 2014

Extensions

Arguments in the Maple program swapped and 4 terms added by R. J. Mathar, Oct 02 2009

A152157 Triangle read by rows: T(n,k) (n>=0, 0<=k<=n) = number of partitions of 2n+1 into 2k+1 odd parts.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 4, 3, 2, 1, 1, 1, 5, 5, 3, 2, 1, 1, 1, 7, 7, 5, 3, 2, 1, 1, 1, 8, 10, 7, 5, 3, 2, 1, 1, 1, 10, 13, 11, 7, 5, 3, 2, 1, 1, 1, 12, 18, 15, 11, 7, 5, 3, 2, 1, 1, 1, 14, 23, 21, 15, 11, 7, 5, 3, 2, 1, 1, 1, 16, 30, 28, 22, 15, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

R. J. Mathar, Sep 25 2009

Keywords

Comments

This number triangle satisfies T(n,k) = A008284(n+k+1,2*k+1), n,k >= 0. This means that T(n,k) is also the number of partitions of N:=n+k+1 into M:=2*k+1 parts. For the proof add 1 to every odd part of each partition of n':=2*n+1 into m:=2*k+1 parts which are all odd, and divide each part by a factor of 2, thus obtaining a partition of n+k+1 into m=2*k+1 parts. All partitions of N,for N>=1, into an odd number of parts M (M from {1,...,N}) are reached: just take k=(M-1)/2 and n=N-1-k. Each partition of N into an odd number of parts can only arise once from the given recipe (for given N and M the k and n values are unique). See also a comment by Franklin T. Adams-Watters on A152140. - Wolfdieter Lang, Jul 09 2012

Examples

			Triangle begins:
1
1  1
1  1   1
1  2   1   1
1  3   2   1   1
1  4   3   2   1   1
1  5   5   3   2   1   1
1  7   7   5   3   2   1  1
1  8  10   7   5   3   2  1  1
1 10  13  11   7   5   3  2  1  1
1 12  18  15  11   7   5  3  2  1  1
1 14  23  21  15  11   7  5  3  2  1  1
1 16  30  28  22  15  11  7  5  3  2  1  1
1 19  37  38  30  22  15 11  7  5  3  2  1  1
1 21  47  49  41  30  22 15 11  7  5  3  2  1 1
1 24  57  65  54  42  30 22 15 11  7  5  3  2 1 1
1 27  70  82  73  56  42 30 22 15 11  7  5  3 2 1  1
1 30  84 105  94  76  56 42 30 22 15 11  7  5 3 2  1 1
1 33 101 131 123  99  77 56 42 30 22 15 11  7 5 3  2 1 1
1 37 119 164 157 131 101 77 56 42 30 22 15 11 7 5  3 2 1 1
From _Wolfdieter Lang_, Jul 09 2012 (Start)
T(5,1) = 4 from the four partitions of 11 into 3 parts, all of which are odd: [1,1,9], [1,3,7], [1,5,5] and [3,3,5].
T(5,1) = 4 from the four partitions of 7 = 5+1+1 into 3 parts:
[1,1,5], [1,2,4], [1,3,3] and [2,2,3].
(End)
		

Crossrefs

Cf. A078408 (row sums), A107379, A152140, A152146, A008284.

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1/sqrt(x), `if`(i<1, 0,
          b(n, i-2)+`if`(i>n, 0, expand(sqrt(x)*b(n-i, i)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(2*n+1, 2*n+1)):
    seq(T(n), n=0..12);  # Alois P. Heinz, Jun 21 2021
  • Mathematica
    (* p = A008284 *) p[n_, 1] = 1; p[n_, k_] := p[n, k] = If[n >= k, Sum[p[n - i, k - 1], {i, 1, n - 1}] - Sum[p[n - i, k], {i, 1, k - 1}], 0];
    T[n_, k_] := p[n + k + 1, 2 k + 1];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 28 2019, after Wolfdieter Lang *)

Formula

T(n,k) = A152140(2n+1,2k+1).
T(n,k) = p(n+k+1,2*k+1), n >= 0, k >= 0, with p(N,M)= A008284(N,M), the number of partitions of N into M parts. See the sketch of the proof given above as a comment. - Wolfdieter Lang, Jul 09 2012
O.g.f. for column k: (x^k)/product(1-x^j,j=1..(2*k+1)), k>=0.
From the o.g.f.s of A008284. - Wolfdieter Lang, Jul 10 2012

Extensions

Indices corrected by R. J. Mathar, Jul 09 2012

A369079 Number of partitions of [n] such that the element sum of each block is odd.

Original entry on oeis.org

1, 1, 1, 2, 4, 10, 28, 96, 320, 1436, 5556, 28768, 129600, 730864, 3756936, 23286784, 132872192, 910013776, 5679982288, 42235062784, 286769980416, 2281079563104, 16732506817280, 141975748567040, 1115928688967680, 10077454948692288, 84383735744758464
Offset: 0

Views

Author

Alois P. Heinz, Jan 12 2024

Keywords

Comments

Number of partitions of [n] such that each block has an odd number of odd elements.

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 1: 12.
a(3) = 2: 12|3, 1|23.
a(4) = 4: 124|3, 12|34, 14|23, 1|234.
a(5) = 10: 12345, 124|3|5, 12|34|5, 12|3|45, 14|23|5, 1|234|5, 1|23|45, 14|25|3, 1|245|3, 1|25|34.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, x, y) option remember; `if`(n=0, `if`(y=0, 1, 0),
         `if`(n::odd, b(n-1, x+1, y)+`if`(x>0, x*b(n-1, x-1, y+1), 0)+
         `if`(y>0, y*b(n-1, x+1, y-1), 0), b(n-1, x, y+1)+(x+y)*b(n-1, x, y)))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..26);
    # second Maple program:
    b:= proc(x, y) option remember; `if`(x+y=0, 1,
          add(`if`(j::odd, binomial(x-1, j-1)*add(
          b(x-j, y-i)*binomial(y, i), i=0..y), 0), j=1..x))
        end:
    a:= n-> (h-> b(n-h, h))(iquo(n, 2)):
    seq(a(n), n=0..26);

A097304 Triangle of numbers of partitions of n with m parts which are all odd.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Aug 13 2004

Keywords

Examples

			[1];
[0,1];
[1,0,1];
[0,1,0,1];
[1,0,1,0,1];
[0,2,0,1,0,1];
...
T(6,2)=2 because 6 = 1+5 = 3+3; T(6,1) = 0 = T(6,3): there are no partitions of 6 into either one or three parts with only odd numbers;
T(6,4)=1 from 6 = 1+1+1+3; T(6,6)=1 from 6 = 1+1+1+1+1+1.
		

Crossrefs

Row sums: A000009 (number of partitions of n into odd parts).
Cf. A008284 (partitions of n into k parts).
Cf. A152140.

Programs

  • Maple
    g:=1/product(1-t*x^(2*j-1),j=1..30)-1: gser:=simplify(series(g,x=0,17)): for n from 1 to 15 do P[n]:=sort(coeff(gser,x^n)) od: seq(seq(coeff(P[n],t^j),j=1..n),n=1..15); # Emeric Deutsch, Feb 24 2006

Formula

T(n, m) := 0 if 1 <= n < m, else T(n, m) = number of partitions of n with m parts which are all odd. Hence T(2*k, 2*j-1) = 0, k >= 1, k >= j >= 1; T(2*k-1, 2*j) = 0, k >= 1, k-1 >= j >= 1.
G.f.: 1/Product_{j>=1} (1 - t*x^(2*j-1)). - Emeric Deutsch, Feb 24 2006
T(n, k) = T(n-1, k-1) + T(n-2*k, k). If n+k is even, T(n, k) = A008284((n+k)/2, k) = A072233((n-k)/2, k); 0 otherwise. - Álvar Ibeas, Jul 25 2020
Showing 1-7 of 7 results.