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 33 results. Next

A216669 Total number of parts in all partitions of n into 2 sizes of parts (A002133).

Original entry on oeis.org

2, 5, 14, 20, 39, 52, 74, 102, 134, 158, 208, 259, 284, 361, 409, 488, 538, 634, 678, 838, 857, 1006, 1038, 1270, 1264, 1495, 1500, 1776, 1761, 2084, 2062, 2443, 2300, 2795, 2680, 3194, 3076, 3544, 3403, 4080, 3804, 4518, 4282, 5037, 4673, 5626, 5127, 6088
Offset: 3

Views

Author

Geoffrey Critzer, Sep 13 2012

Keywords

Comments

Also column k=2 of A255768. - Omar E. Pol, Jul 26 2015

Crossrefs

Programs

  • Mathematica
    nn=40;ss=Sum[Sum[y^2 x^(i+j)/(1-y x^i)/(1-y x^j),{j,1,i-1}], {i,1,nn}]; CoefficientList[Series[D[ss,y]/.y->1,{x,0,nn}],x]

Formula

a(n) = Sum_{k=2..n-1} k * A216665(n,k).

A045845 Duplicate of A002133.

Original entry on oeis.org

1, 2, 5, 6, 11, 13, 17, 22, 27, 29, 37, 44, 44, 55, 59, 68, 71, 81, 82, 102, 97, 112, 109
Offset: 3

Views

Author

Keywords

A238279 Triangle read by rows: T(n,k) is the number of compositions of n into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=A004523(n-1).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 4, 1, 2, 10, 4, 4, 12, 14, 2, 2, 22, 29, 10, 1, 4, 26, 56, 36, 6, 3, 34, 100, 86, 31, 2, 4, 44, 148, 200, 99, 16, 1, 2, 54, 230, 374, 278, 78, 8, 6, 58, 322, 680, 654, 274, 52, 2, 2, 74, 446, 1122, 1390, 814, 225, 22, 1, 4, 88, 573, 1796, 2714, 2058, 813, 136, 10, 4, 88, 778, 2694, 4927
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 22 2014

Keywords

Comments

Same as A238130, with zeros omitted.
Last elements in rows are 1, 1, 2, 2, 1, 4, 2, 1, 6, 2, 1, 8, ... with g.f. -(x^6+x^4-2*x^2-x-1)/(x^6-2*x^3+1).
For n > 0, also the number of compositions of n with k + 1 runs. - Gus Wiseman, Apr 10 2020

Examples

			Triangle starts:
  00:  1;
  01:  1;
  02:  2;
  03:  2,   2;
  04:  3,   4,   1;
  05:  2,  10,   4;
  06:  4,  12,  14,    2;
  07:  2,  22,  29,   10,    1;
  08:  4,  26,  56,   36,    6;
  09:  3,  34, 100,   86,   31,    2;
  10:  4,  44, 148,  200,   99,   16,    1;
  11:  2,  54, 230,  374,  278,   78,    8;
  12:  6,  58, 322,  680,  654,  274,   52,    2;
  13:  2,  74, 446, 1122, 1390,  814,  225,   22,   1;
  14:  4,  88, 573, 1796, 2714, 2058,  813,  136,  10;
  15:  4,  88, 778, 2694, 4927, 4752, 2444,  618,  77,  2;
  16:  5, 110, 953, 3954, 8531, 9930, 6563, 2278, 415, 28, 1;
  ...
Row n=5 is 2, 10, 4 because in the 16 compositions of 5
  ##:  [composition]  no. of changes
  01:  [ 1 1 1 1 1 ]   0
  02:  [ 1 1 1 2 ]   1
  03:  [ 1 1 2 1 ]   2
  04:  [ 1 1 3 ]   1
  05:  [ 1 2 1 1 ]   2
  06:  [ 1 2 2 ]   1
  07:  [ 1 3 1 ]   2
  08:  [ 1 4 ]   1
  09:  [ 2 1 1 1 ]   1
  10:  [ 2 1 2 ]   2
  11:  [ 2 2 1 ]   1
  12:  [ 2 3 ]   1
  13:  [ 3 1 1 ]   1
  14:  [ 3 2 ]   1
  15:  [ 4 1 ]   1
  16:  [ 5 ]   0
there are 2 with no changes, 10 with one change, and 4 with two changes.
		

Crossrefs

Columns k=0-10 give: A000005 (for n>0), 2*A002133, A244714, A244715, A244716, A244717, A244718, A244719, A244720, A244721, A244722.
Row lengths are A004523.
Row sums are A011782.
The version counting adjacent equal parts is A106356.
The version for ascents/descents is A238343.
The version for weak ascents/descents is A333213.
The k-th composition in standard-order has A124762(k) adjacent equal parts, A124767(k) maximal runs, A333382(k) adjacent unequal parts, and A333381(k) maximal anti-runs.

Programs

  • Maple
    b:= proc(n, v) option remember; `if`(n=0, 1, expand(
          add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_, v_] := b[n, v] = If[n == 0, 1, Expand[Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Maple *)
    Table[If[n==0,1,Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[Split[#]]==k+1&]]],{n,0,12},{k,0,If[n==0,0,Floor[2*(n-1)/3]]}] (* Gus Wiseman, Apr 10 2020 *)
  • PARI
    T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N),h=(1+ sum(i=1,N,(x^i-y*x^i)/(1+y*x^i-x^i)))/(1-sum(i=1,N, y*x^i/(1+y*x^i-x^i)))); for(n=0,N-1, print(Vecrev(polcoeff(h,n))))}
    T_xy(16) \\ John Tyler Rascoe, Jul 10 2024

Formula

G.f.: A(x,y) = ( 1 + Sum_{i>0} ((x^i)*(1 - y)/(1 + y*x^i - x^i)) )/( 1 - Sum_{i>0} ((y*x^i)/(1 + y*x^i - x^i)) ). - John Tyler Rascoe, Jul 10 2024

A116608 Triangle read by rows: T(n,k) is number of partitions of n having k distinct parts (n>=1, k>=1).

Original entry on oeis.org

1, 2, 2, 1, 3, 2, 2, 5, 4, 6, 1, 2, 11, 2, 4, 13, 5, 3, 17, 10, 4, 22, 15, 1, 2, 27, 25, 2, 6, 29, 37, 5, 2, 37, 52, 10, 4, 44, 67, 20, 4, 44, 97, 30, 1, 5, 55, 117, 52, 2, 2, 59, 154, 77, 5, 6, 68, 184, 117, 10, 2, 71, 235, 162, 20, 6, 81, 277, 227, 36, 4, 82, 338, 309, 58, 1
Offset: 1

Views

Author

Emeric Deutsch, Feb 19 2006

Keywords

Comments

Row n has floor([sqrt(1+8n)-1]/2) terms (number of terms increases by one at each triangular number).
Row sums yield the partition numbers (A000041).
Row n has length A003056(n), hence the first element of column k is in row A000217(k). - Omar E. Pol, Jan 19 2014

Examples

			T(6,2) = 6 because we have [5,1], [4,2], [4,1,1], [3,1,1,1], [2,2,1,1] and [2,1,1,1,1,1] ([6], [3,3], [3,2,1], [2,2,2] and [1,1,1,1,1,1] do not qualify).
Triangle starts:
  1;
  2;
  2,  1;
  3,  2;
  2,  5;
  4,  6, 1;
  2, 11, 2;
  4, 13, 5;
  3, 17, 10;
  4, 22, 15, 1;
  ...
		

Crossrefs

Cf. A060177 (reflected rows). - Alois P. Heinz, Jan 29 2014
Cf. A274174.

Programs

  • Maple
    g:=product(1+t*x^j/(1-x^j),j=1..30)-1: gser:=simplify(series(g,x=0,27)): for n from 1 to 23 do P[n]:=sort(coeff(gser,x^n)) od: for n from 1 to 23 do seq(coeff(P[n],t^j),j=1..floor(sqrt(1+8*n)/2-1/2)) od; # yields sequence in triangular form
    # second Maple program:
    b:= proc(n, i) option remember; local j; if n=0 then 1
          elif i<1 then 0 else []; for j from 0 to n/i do zip((x, y)
          ->x+y, %, [`if`(j>0, 0, [][]), b(n-i*j, i-1)], 0) od; %[] fi
        end:
    T:= n-> subsop(1=NULL, [b(n, n)])[]:
    seq(T(n), n=1..30); # Alois P. Heinz, Nov 07 2012
    # third program
    nDiffParts := proc(L)
            nops(convert(L,set)) ;
    end proc:
    A116608 := proc(n,k)
            local a,L;
            a :=0 ;
            for L in combinat[partition](n) do
                    if nDiffParts(L) = k then
                            a := a+1 ;
                    end  if;
            end do:
            a ;
    end proc: # R. J. Mathar, Jun 07 2024
  • Mathematica
    p=Product[1+(y x^i)/(1-x^i),{i,1,20}];f[list_]:=Select[list,#>0&];Flatten[Map[f,Drop[CoefficientList[Series[p,{x,0,20}],{x,y}],1]]] (* Geoffrey Critzer, Nov 28 2011 *)
    Table[Length /@ Split[Sort[Length /@ Union /@ IntegerPartitions@n]], {n, 22}] // Flatten (* Robert Price, Jun 13 2020 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy.utilities.iterables import partitions
    def A116608_gen(): # generator of terms
        return (sum(1 for p in partitions(n) if len(p)==k) for n in count(1) for k in range(1,(isqrt((n<<3)+1)-1>>1)+1))
    A116608_list = list(islice(A116608_gen(),30)) # Chai Wah Wu, Sep 14 2023
    
  • Python
    from functools import cache
    @cache
    def P(n: int, k: int, r: int) -> int:
        if n == 0: return 1 if k == 0 else 0
        if k == 0: return 0
        if r == 0: return 0
        return sum(P(n - r * j, k - 1, r - 1)
                   for j in range(1, n // r + 1)) + P(n, k, r - 1)
    def A116608triangle(rows: int) -> list[int]:
        return list(filter(None, [P(n, k, n) for n in range(1, rows)
                                  for k in range(1, n + 1)]))
    print(A116608triangle(22)) # Peter Luschny, Sep 14 2023, courtesy of Amir Livne Bar-on

Formula

G.f.: -1 + Product_{j=1..infinity} 1 + tx^j/(1-x^j).
T(n,1) = A000005(n) (number of divisors of n).
T(n,2) = A002133(n).
T(n,3) = A002134(n).
Sum_{k>=1} k * T(n,k) = A000070(n-1).
Sum_{k>=0} k! * T(n,k) = A274174(n). - Alois P. Heinz, Jun 13 2016
T(n + A000217(k), k) = A000712(n), for 0 <= n <= k [Briand]. - Álvar Ibeas, Nov 04 2020

A238130 Triangle read by rows: T(n,k) is the number of compositions into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 4, 1, 0, 0, 2, 10, 4, 0, 0, 0, 4, 12, 14, 2, 0, 0, 0, 2, 22, 29, 10, 1, 0, 0, 0, 4, 26, 56, 36, 6, 0, 0, 0, 0, 3, 34, 100, 86, 31, 2, 0, 0, 0, 0, 4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0, 2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0, 6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 21 2014

Keywords

Comments

First column (k=0) is A000005, second column (k=1) is 2*A002133.
Row sums are A011782.

Examples

			Triangle starts:
00:  1,
01:  1, 0,
02:  2, 0, 0,
03:  2, 2, 0, 0,
04:  3, 4, 1, 0, 0,
05:  2, 10, 4, 0, 0, 0,
06:  4, 12, 14, 2, 0, 0, 0,
07:  2, 22, 29, 10, 1, 0, 0, 0,
08:  4, 26, 56, 36, 6, 0, 0, 0, 0,
09:  3, 34, 100, 86, 31, 2, 0, 0, 0, 0,
10:  4, 44, 148, 200, 99, 16, 1, 0, 0, 0, 0,
11:  2, 54, 230, 374, 278, 78, 8, 0, 0, 0, 0, 0,
12:  6, 58, 322, 680, 654, 274, 52, 2, 0, 0, 0, 0, 0,
13:  2, 74, 446, 1122, 1390, 814, 225, 22, 1, 0, 0, 0, 0, 0,
...
Row 5 is [2, 10, 4, 0, 0, 0] because in the 16 compositions of 5
##:  [composition]  no. of changes
01:  [ 1 1 1 1 1 ]   0
02:  [ 1 1 1 2 ]   1
03:  [ 1 1 2 1 ]   2
04:  [ 1 1 3 ]   1
05:  [ 1 2 1 1 ]   2
06:  [ 1 2 2 ]   1
07:  [ 1 3 1 ]   2
08:  [ 1 4 ]   1
09:  [ 2 1 1 1 ]   1
10:  [ 2 1 2 ]   2
11:  [ 2 2 1 ]   1
12:  [ 2 3 ]   1
13:  [ 3 1 1 ]   1
14:  [ 3 2 ]   1
15:  [ 4 1 ]   1
16:  [ 5 ]   0
there are 2 with no changes, 10 with one change, and 4 with two changes.
		

Crossrefs

Cf. A238279 (same sequence with zeros omitted).
Cf. A106356 (compositions with k successive parts same).
Cf. A225084 (compositions with maximal up-step k).

Programs

  • Maple
    b:= proc(n, v) option remember; `if`(n=0, 1, expand(
          add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
        end:
    T:= n-> seq(coeff(b(n, 0), x, i), i=0..n):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_, v_] := b[n, v] = If[n == 0, 1, Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]; T[n_] := Table[Coefficient[b[n, 0], x, i], {i, 0, n}]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 12 2015, translated from Maple *)

A060177 Triangle of generalized sum of divisors function, read by rows.

Original entry on oeis.org

1, 2, 1, 2, 2, 3, 5, 2, 1, 6, 4, 2, 11, 2, 5, 13, 4, 10, 17, 3, 1, 15, 22, 4, 2, 25, 27, 2, 5, 37, 29, 6, 10, 52, 37, 2, 20, 67, 44, 4, 1, 30, 97, 44, 4, 2, 52, 117, 55, 5, 5, 77, 154, 59, 2, 10, 117, 184, 68, 6, 20, 162, 235, 71, 2, 36, 227, 277, 81, 6, 1, 58, 309, 338
Offset: 1

Views

Author

N. J. A. Sloane, Mar 20 2001

Keywords

Comments

Lengths of rows are 1 1 2 2 2 3 3 3 3 4 4 4 4 4 ... (A003056).

Examples

			Triangle turned on its side begins:
  1  2  2  3  2  4  2  4  3  4  2  6 ...
        1  2  5  6 11 13 17 22 27 29 ...
                 1  2  5 10 15 25 37 ...
                             1  2  5 ...
		

Crossrefs

Cf. A116608 (reflected rows). - Alois P. Heinz, Jan 29 2014

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          expand(b(n, i-1) +x*add(b(n-i*j, i-1), j=1..n/i))))
        end:
    T:= n->(p->seq(coeff(p, x, degree(p)-k), k=0..degree(p)-1))(b(n$2)):
    seq(T(n), n=1..25);  # Alois P. Heinz, Jan 29 2014
  • Mathematica
    Reverse /@ Table[Length /@ Split[ Sort[Map[Length, Split /@ IntegerPartitions[n], {1}]]], {n, 24}] (* Wouter Meeussen, Apr 21 2012, updated by Jean-François Alcover, Jan 29 2014 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    from sympy.utilities.iterables import partitions
    def A060177_gen(): # generator of terms
        return (sum(1 for p in partitions(n) if len(p)==k) for n in count(1) for k in range(isqrt((n<<3)+1)-1>>1,0,-1))
    A060177_list = list(islice(A060177_gen(),30)) # Chai Wah Wu, Sep 15 2023

Formula

T(n,k) = Partitions of n using only k types of piles. Also, Sum_{k=1..A003056(n)} T(n,k)*k = A000070(n). Also, Sum_{k=1..A003056(n)} T(n,k)*(k-1) = A058884(n). - Naohiro Nomoto, Jan 24 2002
G.f. for k-th diagonal (the k-th row of the sideways triangle shown in the example): Sum_{ m_1 < m_2 < ... < m_k} q^(m_1+m_2+...+m_k)/((1-q^m_1)*(1-q^m_2)*...*(1-q^m_k)) = Sum_n T(n, k)*q^n.

Extensions

More terms from Naohiro Nomoto, Jan 24 2002

A100073 Number of representations of n as the difference of two positive squares.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Nov 02 2004

Keywords

Comments

Note that for odd n, a(n) = 1 iff n is a prime, or a prime squared.
A decomposition n = a^2 - b^2 = (a-b)(a+b) = d*(n/d) is given for each divisor d less than (as to exclude b = 0) but having the same parity as n/d. For even n this implies that d and n/d must be even, i.e., 4 | n. This leads to the given formula, a(n) = floor(numdiv(n)/2) for odd n, floor(numdiv(n/4)/2) for n = 4k, 0 else. - M. F. Hasler, Jul 10 2018
a(n) is the number of self-conjugate partitions of n into parts of 2 different sizes, i.e., the order of the set of partitions obtained by the intersection of the partitions in A000700 and A002133. See A270060. - R. J. Mathar, Jun 15 2022

Examples

			a(15) = 2 because 15 = 16 - 1 = 64 - 49.
		

Crossrefs

Cf. A056924 (number of divisors of n that are less than sqrt(n)), A016825 (numbers not the difference of two squares), A034178 (number of representations of n as the difference of two squares).

Programs

  • Maple
    A100073:= proc(n)
      if n::odd then floor(numtheory:-tau(n)/2)
      elif (n/2)::odd then 0
      else floor(numtheory:-tau(n/4)/2)
      fi
    end proc:
    map(A100073, [$1..200]); # Robert Israel, Jul 10 2018
  • Mathematica
    nn=150; a=Table[0, {nn}]; Do[y=x-1; While[d=x^2-y^2; d<=nn&&y>0, a[[d]]++; y-- ], {x, 1+nn/2}]; a
  • PARI
    a(n) = if (n % 2, ceil((numdiv(n)-1)/2), if (!(n%4),  ceil((numdiv(n/4)-1)/2), 0)); \\ Michel Marcus, Mar 07 2016
    
  • PARI
    A100073(n)=if(bittest(n,0),numdiv(n)\2,!bittest(n,1),numdiv(n\4)\2) \\ or shorter: a(n)=if(n%4!=2,numdiv(n\4^!(n%2))\2) \\ - M. F. Hasler, Jul 10 2018

Formula

a(n) = A056924(n) for odd n, a(n) = A056924(n/4) if 4|n, otherwise a(n) = 0.

A309058 Partitions of n with parts having at most 3 distinct magnitudes.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 41, 54, 72, 91, 115, 145, 177, 215, 258, 308, 364, 424, 491, 568, 651, 742, 838, 940, 1065, 1181, 1320, 1454, 1619, 1757, 1957, 2124, 2329, 2510, 2763, 2934, 3244, 3432, 3752, 3964, 4329, 4531, 4965, 5179, 5627, 5872, 6391, 6577, 7178, 7405
Offset: 0

Views

Author

Nathan McNew, Jul 09 2019

Keywords

Comments

Partitions whose Ferrers diagrams do not contain the pattern 4321 under removal of rows and columns (as defined by Bloom and Saracino).

Examples

			a(10) = 41 because all of the 42 integer partitions of 10 count (i.e., 10 = 10, 10 = 9+1 = 8+1+1, etc.), except the partition 10 = 4+3+2+1.
		

Crossrefs

Cf. A265250 (partitions of n with parts having at most 2 distinct magnitudes). Sum of A002134, A002133 and A000005.
Cf. A116608.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(i<1, 0,
          `if`(t=1, `if`(irem(n, i)=0, 1, 0)+b(n, i-1, t),
           add(b(n-i*j, i-1, t-`if`(j=0, 0, 1)), j=0..n/i))))
        end:
    a:= n-> b(n$2, 3):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 11 2019
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, 1, If[i < 1, 0, If[t == 1, If[Mod[n, i] == 0, 1, 0] + b[n, i - 1, t], Sum[b[n - i*j, i - 1, t - If[j == 0, 0, 1]], {j, 0, n/i}]]]];
    a[n_] := b[n, n, 3];
    a /@ Range[0, 100] (* Jean-François Alcover, Feb 27 2020, after Alois P. Heinz *)

Formula

G.f.: Sum_{i>=1} x^i/(1-x^i) + Sum_{j=1..i-1} x^(i+j)/((1-x^i)*(1-x^j)) + Sum_{k=1..j-1} x^(i+j+k)/((1-x^i)*(1-x^j)*(1-x^k)).
a(n) = Sum_{k=0..3} A116608(n,k). - Alois P. Heinz, Jul 11 2019

A059820 Expansion of series related to Liouville's Last Theorem: g.f. Sum_{t>0} (-1)^(t+1) *x^(t*(t+1)/2) / ( (1-x^t)^3 *Product_{i=1..t} (1-x^i) ).

Original entry on oeis.org

0, 1, 4, 9, 19, 30, 52, 70, 107, 136, 191, 226, 314, 352, 463, 523, 664, 717, 919, 964, 1205, 1282, 1546, 1603, 1992, 2009, 2414, 2504, 2958, 2974, 3606, 3553, 4223, 4273, 4936, 4912, 5885, 5685, 6634, 6654, 7664, 7454, 8822, 8454, 9845
Offset: 0

Views

Author

N. J. A. Sloane, Feb 24 2001

Keywords

Crossrefs

Cf. A000005 (k=1), A059819 (k=2), A059820 (k=3), A059821(k=4), A059822 (k=5), A059823 (k=6), A059824 (k=7), A059825 (k=8).
Cf. A000203, A001157, A055507, A191829 (Andrews's D_{0,0,0}(n)), A191831 (Andrews's D_{0,1}(n)).

Programs

  • Maple
    Mk := proc(k) -1*add( (-1)^n*q^(n*(n+1)/2)/(1-q^n)^k/mul(1-q^i,i=1..n), n=1..101): end; # with k=3
  • PARI
    D(x, y, n) = sum(k=1, n-1, sigma(k, x)*sigma(n-k, y));
    D000(n) = sum(k=1, n-1, sigma(k, 0)*D(0, 0, n-k));
    a(n) = if(n==0, 0, (3*D(0, 0, n)+3*D(0, 1, n)+D000(n)+2*sigma(n, 0)+3*sigma(n)+sigma(n, 2))/6); \\ Seiichi Manyama, Jul 26 2024

Formula

a(n) = ( 3*A055507(n-1) + 3*A191831(n) + A191829(n) + 2*sigma_0(n) + 3*sigma(n) + sigma_2(n) )/6. - Seiichi Manyama, Jul 26 2024

A365676 Triangle read by rows: T(n, k) is the number of partitions of n having exactly k distinct part sizes, for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 0, 2, 1, 0, 0, 3, 2, 0, 0, 0, 2, 5, 0, 0, 0, 0, 4, 6, 1, 0, 0, 0, 0, 2, 11, 2, 0, 0, 0, 0, 0, 4, 13, 5, 0, 0, 0, 0, 0, 0, 3, 17, 10, 0, 0, 0, 0, 0, 0, 0, 4, 22, 15, 1, 0, 0, 0, 0, 0, 0, 0, 2, 27, 25, 2, 0, 0, 0, 0, 0, 0, 0, 0, 6, 29, 37, 5, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Peter Luschny, Sep 15 2023

Keywords

Examples

			Triangle T(n, k) starts:
  [0] 1;
  [1] 0, 1;
  [2] 0, 2,  0;
  [3] 0, 2,  1,  0;
  [4] 0, 3,  2,  0, 0;
  [5] 0, 2,  5,  0, 0, 0;
  [6] 0, 4,  6,  1, 0, 0, 0;
  [7] 0, 2, 11,  2, 0, 0, 0, 0;
  [8] 0, 4, 13,  5, 0, 0, 0, 0, 0;
  [9] 0, 3, 17, 10, 0, 0, 0, 0, 0, 0;
		

Crossrefs

Variants: A116608 (nonzero terms), A060177.
Cf. A000041 (row sums), A000005 (T(n,1)), A002133 (T(n,2)), A002134 (T(n,3)), A365630 (T(n,4)), A365631 (T(n,5)).

Programs

  • Maple
    P := proc(n, k, r) option remember; local j;  # after Amir Livne Bar-on
      if n = 0 then return ifelse(k = 0, 1, 0) fi;
      if k = 0 or r = 0 then return 0 fi;
      add(P(n - r * j, k - 1, r - 1), j = 1..iquo(n, r)) + P(n, k, r - 1) end:
    A365676row := n -> local k; seq(P(n, k, n), k = 0..n):
    seq(print(A365676row(n)), n = 0..9);
    # Using the generating function:
    p := product(1 + t*x^j/(1 - x^j), j = 1..20):
    ser := series(p, x, 20):
    seq(seq(coeff(coeff(ser, x, n), t, k), k = 0..n), n = 0..9);
  • Mathematica
    P[n_, k_, r_] := P[n, k, r] = Which[n == 0, If[k == 0, 1, 0], k == 0 || r == 0, 0, True, Sum[P[n-r*j, k-1, r-1], {j, 1, Quotient[n, r]}]+P[n, k, r-1]]; A365676row[n_] := Table[P[n, k, n], {k, 0, n}]; Table[A365676row[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Oct 21 2023, from 1st Maple program *)
  • PARI
    T(n,k) = my(nb=0); forpart(p=n, if (#Set(p) == k, nb++)); nb; \\ Michel Marcus, Sep 17 2023
  • Python
    # after Amir Livne Bar-on
    from functools import cache
    @cache
    def P(n: int, k: int, r: int) -> int:
        if n == 0: return 1 if k == 0 else 0
        if k == 0 or r == 0: return 0
        return sum(P(n - r * j, k - 1, r - 1)
                   for j in range(1, n // r + 1)) + P(n, k, r - 1)
    def A365676Row(n) -> list[int]:
        return [P(n, k, n) for k in range(n + 1)]
    for n in range(10): print(A365676Row(n))
    

Formula

T(n, k) = [t^k][x^n] Product_{j>=1} (1 + t*x^j / (1 - x^j)).
T(n, k) = 0 for n>0 and k=0. T(n,k) = 0 for k > floor([sqrt(1+8n)-1]/2). - Chai Wah Wu, Sep 15 2023
Showing 1-10 of 33 results. Next