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

A117142 Number of partitions of n in which any two parts differ by at most 2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 14, 15, 20, 21, 27, 28, 35, 36, 44, 45, 54, 55, 65, 66, 77, 78, 90, 91, 104, 105, 119, 120, 135, 136, 152, 153, 170, 171, 189, 190, 209, 210, 230, 231, 252, 253, 275, 276, 299, 300, 324, 325, 350, 351, 377, 378, 405, 406, 434, 435, 464, 465
Offset: 1

Views

Author

Emeric Deutsch, Feb 27 2006

Keywords

Comments

Equals row sums of triangle A177991. - Gary W. Adamson, May 16 2010
Positive numbers that are either triangular (A000217) or triangular minus 1 (A000096). - Jon E. Schoenfield, Jun 12 2010

Examples

			a(6) = 9 because we have
  1: [6],
  2: [4, 2],
  3: [3, 3],
  4: [3, 2, 1],
  5: [3, 1, 1, 1],
  6: [2, 2, 2],
  7: [2, 2, 1, 1],
  8: [2, 1, 1, 1, 1],
  9: [1, 1, 1, 1, 1, 1]
([5,1] and [4,1,1] do not qualify).
		

Crossrefs

Column k=2 of A194621. - Alois P. Heinz, Oct 17 2012

Programs

  • GAP
    List([1..60],n->(2*n^2+10*n+3+(-1)^n*(2*n-3))/16); # Muniru A Asiru, Dec 21 2018
    
  • Magma
    [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16: n in [1..60]]; // G. C. Greubel, Jul 18 2023
    
  • Maple
    g:=sum(x^k/(1-x^k)/(1-x^(k+1))/(1-x^(k+2)),k=1..75): gser:=series(g,x=0,70): seq(coeff(gser,x^n),n=1..65); with(combinat): for n from 1 to 7 do P:=partition(n): A:={}: for j from 1 to nops(P) do if P[j][nops(P[j])]-P[j][1]<3 then A:=A union {P[j]} else A:=A fi od: print(A); od: # this program yields the partitions
  • Mathematica
    Table[Count[IntegerPartitions[n], ?(Max[#] - Min[#] <= 2 &)], {n, 30}] (* _Birkas Gyorgy, Feb 20 2011 *)
    Table[(2*n^2 +10*n +3 +(-1)^n*(2*n-3))/16, {n,30}] (* Birkas Gyorgy, Feb 20 2011 *)
    Table[Sum[If[EvenQ[k], 1, (k+1)/2], {k,0,n}], {n,0,60}] (* Jon Maiga, Dec 21 2018 *)
  • PARI
    Vec(x*(x^2-x-1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
    
  • SageMath
    [(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16 for n in range(1,61)] # G. C. Greubel, Jul 18 2023

Formula

G.f.: Sum_{k>=1} x^k/((1 - x^k)*(1 - x^(k + 1))*(1 - x^(k + 2))). More generally, the g.f. of the number of partitions in which any two parts differ by at most b is Sum_{k>=1} (x^k/(Product_{j=k..k+b} 1 - x^j)).
a(n) = (2*n^2 + 10*n + 3 + (-1)^n * (2*n - 3))/16. - Birkas Gyorgy, Feb 20 2011
G.f.: (1 + x)/(1 - x)/(Q(0) - x^2 - x^3), where Q(k) = 1 + x^2 + x^3 + k*x*(1 + x^2) - x^2*(1 + x*(k + 2))*(1 + k*x)/Q(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Jan 05 2014
G.f.: x*(1 + x - x^2)/((1 - x)^3*(1 + x)^2). - Colin Barker, Mar 05 2015
a(n) = Sum_{k=0..n-1} A152271(k). - Jon Maiga, Dec 21 2018
E.g.f.: (1/16)*( (3 + 2*x)*exp(-x) + (3 + 12*x + 2*x^2)*exp(x) ). - G. C. Greubel, Jul 18 2023
a(n) = A152919(n+1)/2. - Ridouane Oudra, Oct 29 2024

A117143 Number of partitions of n in which any two parts differ by at most 3.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 13, 17, 22, 27, 33, 41, 48, 57, 68, 78, 90, 105, 118, 134, 153, 170, 190, 214, 235, 260, 289, 315, 345, 380, 411, 447, 488, 525, 567, 615, 658, 707, 762, 812, 868, 931, 988, 1052, 1123, 1188, 1260, 1340, 1413, 1494, 1583, 1665, 1755, 1854
Offset: 1

Views

Author

Emeric Deutsch, Feb 27 2006

Keywords

Examples

			a(6) = 10 because we have [6], [4,2], [4,1,1], [3,3], [3,2,1], [3,1,1,1], [2,2,2], [2,2,1,1], [2,1,1,1,1] and [1,1,1,1,1,1] ([5,1] does not qualify).
		

Crossrefs

Cf. A117142.
Column k=3 of A194621.

Programs

  • Magma
    [(2*Floor((n+2)/3)*(14*Floor((n+2)/3)^2-(10*n+21)*Floor((n+2)/3)+2*(n^2+5*n+7))-(1-(-1)^Floor((n+2)/3))*(-1)^(n+2-Floor((n+2)/3)))/16: n in [1..60]]; // Vincenzo Librandi, May 12 2015
  • Maple
    g:=sum(x^k/(1-x^k)/(1-x^(k+1))/(1-x^(k+2))/(1-x^(k+3)),k=1..85): gser:=series(g,x=0,65): seq(coeff(gser,x^n),n=1..59); with(combinat): for n from 1 to 7 do P:=partition(n): A:={}: for j from 1 to nops(P) do if P[j][nops(P[j])]-P[j][1]<4 then A:=A union {P[j]} else A:=A fi od: print(A); od: # this program yields the partitions
  • Mathematica
    Table[Count[IntegerPartitions[n], ?(Max[#] - Min[#] <= 3 &)], {n, 30}] (* _Birkas Gyorgy, Feb 20 2011 *)
  • PARI
    Vec(x*(x^5-x^4-x^3+x+1)/((x-1)^4*(x+1)*(x^2+x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
    

Formula

G.f.: sum(x^k/[(1-x^k)(1-x^(k+1))(1-x^(k+2))(1-x^(k+3))], k=1..infinity). More generally, the g.f. of the number of partitions in which any two parts differ by at most b is sum(x^k/product(1-x^j, j=k..k+b), k=1..infinity).
G.f.: x*(x^5-x^4-x^3+x+1) / ((x-1)^4*(x+1)*(x^2+x+1)^2). - Colin Barker, Mar 05 2015
a(n)=(2*floor((n+2)/3)*(14*floor((n+2)/3)^2-(10*n+21)*floor((n+2)/3)+2*(n^2+5*n+7))-(1-(-1)^floor((n+2)/3))*(-1)^(n+2-floor((n+2)/3)))/16. - Luce ETIENNE, May 12 2015

A218506 Number of partitions of n in which any two parts differ by at most 4.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 14, 20, 25, 34, 41, 54, 64, 81, 95, 118, 136, 165, 189, 226, 256, 301, 339, 395, 441, 507, 564, 644, 711, 804, 885, 995, 1089, 1215, 1326, 1473, 1600, 1766, 1914, 2105, 2272, 2486, 2678, 2921, 3136, 3406, 3650, 3954, 4225, 4560, 4865
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=4 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 4), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
    a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 4], {i, 1, n}];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)
  • PARI
    Vec((x^14-x^13-x^12+2*x^9-x^6-x^5+x^4-1)/((x-1)^5*(x+1)^3*(x^2+1)^2*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Mar 05 2015

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..4} (1-x^(i+j)).
G.f.: (x^14-x^13-x^12+2*x^9-x^6-x^5+x^4-1) / ((x-1)^5*(x+1)^3*(x^2+1)^2*(x^2+x+1)). - Colin Barker, Mar 05 2015

A218507 Number of partitions of n in which any two parts differ by at most 5.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 21, 28, 37, 48, 62, 78, 98, 121, 149, 181, 219, 262, 313, 370, 436, 510, 595, 690, 797, 916, 1050, 1198, 1364, 1545, 1747, 1968, 2212, 2479, 2771, 3089, 3437, 3814, 4226, 4669, 5151, 5670, 6232, 6837, 7487, 8185, 8936, 9739, 10602
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=5 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 5), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    LinearRecurrence[{1,1,0,0,0,-2,-2,1,1,2,1,1,-2,-2,0,0,0,1,1,-1},{1,1,2,3,5,7,11,15,21,28,37,48,62,78,98,121,149,181,219,262,313},60] (* Harvey P. Dale, Jan 18 2016 *)
  • PARI
    Vec((x^20-x^19-x^18+x^15+x^14+x^13-x^12-x^11-x^10+x^7+x^6-x^5+1)/((x-1)^6*(x+1)^2*(x^2+1)*(x^2+x+1)*(x^4+x^3+x^2+x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..5} (1-x^(i+j)).
G.f.: (x^20 -x^19 -x^18 +x^15 +x^14 +x^13 -x^12 -x^11 -x^10 +x^7 +x^6 -x^5 +1) / ((x -1)^6*(x +1)^2*(x^2 +1)*(x^2 +x +1)*(x^4 +x^3 +x^2 +x +1)^2). - Colin Barker, Mar 05 2015

A218508 Number of partitions of n in which any two parts differ by at most 6.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 29, 40, 51, 69, 86, 112, 139, 176, 214, 268, 321, 394, 470, 567, 668, 800, 933, 1103, 1281, 1498, 1725, 2006, 2293, 2643, 3010, 3443, 3897, 4438, 4995, 5652, 6341, 7135, 7967, 8932, 9930, 11079, 12283, 13645, 15071, 16692, 18372
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=6 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 6), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
    a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 6], {i, 1, n}];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..6} (1-x^(i+j)).

A218509 Number of partitions of n in which any two parts differ by at most 7.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 41, 54, 72, 93, 120, 153, 194, 242, 302, 372, 457, 556, 675, 812, 975, 1162, 1381, 1632, 1923, 2254, 2636, 3068, 3562, 4119, 4752, 5462, 6265, 7162, 8170, 9293, 10549, 11942, 13495, 15211, 17115, 19214, 21534, 24083, 26892
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=7 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 7), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
    a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 7], {i, 1, n}];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..7} (1-x^(i+j)).

A218510 Number of partitions of n in which any two parts differ by at most 8.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 55, 75, 96, 127, 161, 208, 260, 330, 407, 509, 621, 765, 925, 1127, 1350, 1627, 1934, 2310, 2725, 3227, 3782, 4446, 5178, 6044, 7000, 8122, 9355, 10791, 12370, 14195, 16196, 18494, 21012, 23887, 27029, 30596, 34492, 38894
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=8 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 8), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
    a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 8], {i, 1, n}];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..8} (1-x^(i+j)).

A218511 Number of partitions of n in which any two parts differ by at most 9.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 76, 99, 130, 168, 216, 274, 348, 435, 544, 674, 831, 1017, 1244, 1507, 1823, 2193, 2629, 3136, 3734, 4420, 5223, 6148, 7215, 8438, 9850, 11453, 13292, 15382, 17758, 20447, 23502, 26935, 30818, 35181, 40082, 45570
Offset: 0

Views

Author

Alois P. Heinz, Oct 31 2012

Keywords

Crossrefs

Column k=9 of A194621.

Programs

  • Maple
    b:= proc(n, i, k) option remember; `if`(n<0 or k<0, 0,
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, k-1) +b(n-i, i, k))))
        end:
    a:= n-> `if`(n=0, 1, 0) +add(b(n-i, i, 9), i=1..n):
    seq(a(n), n=0..80);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 0 || k < 0, 0, If[n == 0, 1, If[i < 1, 0, b[n, i - 1, k - 1] + b[n - i, i, k]]]];
    a[n_] := If[n == 0, 1, 0] + Sum[b[n - i, i, 9], {i, 1, n}];
    Table[a[n], {n, 0, 80}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)

Formula

G.f.: 1 + Sum_{j>0} x^j / Product_{i=0..9} (1-x^(i+j)).

A218567 Number of partitions p of n such that max(p)-min(p) = 4.

Original entry on oeis.org

1, 1, 3, 3, 7, 8, 13, 16, 24, 27, 40, 46, 60, 71, 92, 103, 131, 149, 181, 206, 247, 275, 329, 366, 424, 474, 548, 601, 690, 759, 858, 942, 1059, 1152, 1293, 1404, 1555, 1690, 1869, 2013, 2218, 2390, 2614, 2812, 3066, 3282, 3574, 3820, 4131, 4415, 4769, 5071
Offset: 6

Views

Author

Alois P. Heinz, Nov 02 2012

Keywords

Programs

Formula

G.f.: Sum_{k>0} x^(2*k+4)/Product_{j=0..4} (1-x^(k+j)).
a(n) = A097364(n,4) = A116685(n,4) = A194621(n,4) - A194621(n,3) = A218506(n) - A117143(n).

A218573 Number of partitions p of n such that max(p) - min(p) = 10.

Original entry on oeis.org

1, 1, 3, 3, 7, 8, 14, 18, 28, 35, 53, 67, 93, 119, 161, 201, 267, 332, 428, 531, 674, 824, 1034, 1258, 1552, 1877, 2294, 2749, 3332, 3970, 4762, 5645, 6723, 7916, 9367, 10974, 12894, 15036, 17571, 20381, 23696, 27370, 31652, 36416, 41926, 48029, 55071, 62860
Offset: 12

Views

Author

Alois P. Heinz, Nov 02 2012

Keywords

Programs

Formula

G.f.: Sum_{k>0} x^(2*k+10)/Product_{j=0..10} (1-x^(k+j)).
a(n) = A097364(n,10) = A116685(n,10) = A194621(n,10) - A194621(n,9) = A218512(n) - A218511(n).
Showing 1-10 of 16 results. Next