A194621
Triangle T(n,k), n>=0, 0<=k<=n, read by rows: T(n,k) is the number of partitions of n in which any two parts differ by at most k.
Original entry on oeis.org
1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 5, 2, 5, 6, 7, 7, 7, 4, 6, 9, 10, 11, 11, 11, 2, 7, 10, 13, 14, 15, 15, 15, 4, 8, 14, 17, 20, 21, 22, 22, 22, 3, 9, 15, 22, 25, 28, 29, 30, 30, 30, 4, 10, 20, 27, 34, 37, 40, 41, 42, 42, 42, 2, 11, 21, 33, 41, 48, 51, 54, 55, 56, 56, 56
Offset: 0
T(6,0) = 4: [6], [3,3], [2,2,2], [1,1,1,1,1,1].
T(6,1) = 6: [6], [3,3], [2,1,1,1,1], [2,2,1,1], [2,2,2], [1,1,1,1,1,1].
T(6,2) = 9: [6], [4,2], [3,1,1,1], [3,2,1], [3,3], [2,1,1,1,1], [2,2,1,1], [2,2,2], [1,1,1,1,1,1].
Triangle begins:
1;
1, 1;
2, 2, 2;
2, 3, 3, 3;
3, 4, 5, 5, 5;
2, 5, 6, 7, 7, 7;
4, 6, 9, 10, 11, 11, 11;
2, 7, 10, 13, 14, 15, 15, 15;
Columns k=0-10 give (for n>0):
A000005,
A000027,
A117142,
A117143,
A218506,
A218507,
A218508,
A218509,
A218510,
A218511,
A218512.
-
b:= proc(n, i, k) option remember;
if n<0 or k<0 then 0
elif n=0 then 1
elif i<1 then 0
else b(n, i-1, k-1) +b(n-i, i, k)
fi
end:
T:= (n, k)-> `if`(n=0, 1, 0) +add(b(n-i, i, k), i=1..n):
seq(seq(T(n, k), k=0..n), n=0..20);
-
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]]]]; t[n_, k_] := If[n == 0, 1, 0] + Sum[b[n-i, i, k], {i, 1, n}]; Table[Table[t[n, k], {k, 0, n}], {n, 0, 20}] // Flatten (* Jean-François Alcover, Dec 09 2013, translated from Maple *)
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
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).
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
- Jonathan Bloom and Nathan McNew, Counting pattern-avoiding integer partitions, arXiv:1908.03953 [math.CO], 2019.
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
-
List([1..60],n->(2*n^2+10*n+3+(-1)^n*(2*n-3))/16); # Muniru A Asiru, Dec 21 2018
-
[(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16: n in [1..60]]; // G. C. Greubel, Jul 18 2023
-
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
-
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 *)
-
Vec(x*(x^2-x-1)/((x-1)^3*(x+1)^2) + O(x^100)) \\ Colin Barker, Mar 05 2015
-
[(2*n*(n+5) +3 +(-1)^n*(2*n-3))/16 for n in range(1,61)] # G. C. Greubel, Jul 18 2023
A128508
Number of partitions p of n such that max(p) - min(p) = 3.
Original entry on oeis.org
0, 0, 0, 0, 0, 1, 1, 3, 3, 7, 7, 12, 14, 20, 22, 32, 34, 45, 51, 63, 69, 87, 93, 112, 124, 144, 156, 184, 196, 225, 245, 275, 295, 335, 355, 396, 426, 468, 498, 552, 582, 637, 679, 735, 777, 847, 889, 960, 1016, 1088, 1144, 1232, 1288, 1377, 1449, 1539, 1611, 1719
Offset: 0
-
np[n_]:=Length[Select[IntegerPartitions[n],Max[#]-Min[#]==3&]]; Array[np,60] (* Harvey P. Dale, Jul 02 2012 *)
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
-
terms = 52; offset = 6; max = terms + offset; s[k0_ /; k0>0] := Sum[x^(2*k + k0) / Product[ (1 - x^(k+j)), {j, 0, k0}], {k, 1, Ceiling[max/2]}] + O[x]^max // CoefficientList[#, x]&; Drop[s[4], offset] (* Jean-François Alcover, Sep 11 2017, after Alois P. Heinz *)
Table[Count[IntegerPartitions[n],?(#[[1]]-#[[-1]]==4&)],{n,6,60}] (* _Harvey P. Dale, Jul 10 2021 *)
A248851
a(n) = ( 2*n*(2*n^2 + 9*n + 14) + (-1)^n - 1 )/16.
Original entry on oeis.org
0, 3, 10, 22, 41, 68, 105, 153, 214, 289, 380, 488, 615, 762, 931, 1123, 1340, 1583, 1854, 2154, 2485, 2848, 3245, 3677, 4146, 4653, 5200, 5788, 6419, 7094, 7815, 8583, 9400, 10267, 11186, 12158, 13185, 14268, 15409, 16609, 17870, 19193, 20580, 22032
Offset: 0
From third comment: a(0)=0, a(1)=1+2, a(2)=4+6, a(3)=10+12, a(4)=20+21, a(5)=35+33.
- Colin Barker, Table of n, a(n) for n = 0..1000
- Luce ETIENNE, Illustration for a(1), a(2), a(3), a(4), a(5)
- Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).
-
[(4*n^3+18*n^2+28*n-(1-(-1)^n)) div 16: n in [0..50]]; // Vincenzo Librandi, Mar 21 2015
-
CoefficientList[Series[x (x^3 - 2 x^2 + x + 3) / ((x - 1)^4(x + 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Mar 21 2015 *)
LinearRecurrence[{3,-2,-2,3,-1},{0,3,10,22,41},50] (* Harvey P. Dale, Jan 17 2023 *)
-
concat(0, Vec(x*(x^3-2*x^2+x+3)/((x-1)^4*(x+1)) + O(x^100))) \\ Colin Barker, Mar 03 2015
A276027
Number of ways to transform a sequence of n ones to a single number by continually removing two numbers and replacing them with their sum modulo 3.
Original entry on oeis.org
1, 1, 1, 2, 4, 7, 18, 43, 93, 266, 702, 1687, 5136, 14405, 36898, 117016, 341842, 914064, 2983027, 8972121, 24743851, 82478973, 253555061, 715745648, 2424954125, 7582390623, 21796481477, 74805170349, 237095926682, 691568408221, 2398418942361, 7686495623620
Offset: 1
For n = 4, the two ways are 1111 -> 211 -> 10 -> 1 and 1111 -> 211 -> 22 -> 1.
Similar to
A002846 with nodes taken modulo 3.
A117143 is the total number of nodes in this poset.
-
b:= proc(x, y, z) option remember;
`if`(x+y+z=1, 1, `if`(y>0 and z>0, b(x+1, y-1, z-1), 0)+
`if`(x>1 or x>0 and y>0 or x>0 and z>0, b(x-1, y, z), 0)+
`if`(y>1, b(x, y-2, z+1), 0)+`if`(z>1, b(x, y+1, z-2), 0))
end:
a:= n-> b(0, n, 0):
seq(a(n), n=1..35); # Alois P. Heinz, Aug 18 2016
-
b[x_,y_,z_] := b[x, y, z] = If[x+y+z==1, 1, If[y>0 && z>0, b[x+1, y-1, z-1], 0] + If[x>1 || x>0 && y>0 || x>0 && z>0, b[x-1, y, z], 0] + If[y>1, b[x, y-2, z+1], 0] + If[z>1, b[x, y+1, z-2], 0]]; a[n_]:= b[0, n, 0]; Array[a,35] (* Jean-François Alcover, Aug 07 2017, after Alois P. Heinz *)
-
from sympy.core.cache import cacheit
@cacheit
def b(x, y, z): return 1 if x + y + z==1 else (b(x + 1, y - 1, z - 1) if y>0 and z>0 else 0) + (b(x - 1, y, z) if x>1 or x>0 and y>0 or x>0 and z>0 else 0) + (b(x, y - 2, z + 1) if y>1 else 0) + (b(x, y + 1, z - 2) if z>1 else 0)
def a(n): return b(0, n, 0)
print([a(n) for n in range(1, 36)]) # Indranil Ghosh, Aug 09 2017, after Maple code
A256666
a(n) = ( 2*n*(2*n^2 + 11*n + 26) - (-1)^n + 1 )/16.
Original entry on oeis.org
0, 5, 14, 29, 51, 82, 123, 176, 242, 323, 420, 535, 669, 824, 1001, 1202, 1428, 1681, 1962, 2273, 2615, 2990, 3399, 3844, 4326, 4847, 5408, 6011, 6657, 7348, 8085, 8870, 9704, 10589, 11526, 12517, 13563, 14666, 15827, 17048, 18330, 19675, 21084, 22559
Offset: 0
From third comment: a(0)=0, a(1)=1+4, a(2)=4+10, a(3)=10+19, a(4)=20+31, a(5)=35+47, a(6)=56+67.
-
[(4*n^3+22*n^2+52*n+1-(-1)^n)/16: n in [0..50]]; // Vincenzo Librandi, Apr 08 2015
-
Table[(4 n^3 + 22 n^2 + 52 n + 1 - (-1)^n)/16, {n, 0, 50}] (* Vincenzo Librandi, Apr 08 2015 *)
LinearRecurrence[{3,-2,-2,3,-1},{0,5,14,29,51},50] (* Harvey P. Dale, Aug 18 2020 *)
-
concat(0, Vec(x*(2*x^3-3*x^2-x+5)/((x-1)^4*(x+1)) + O(x^100))) \\ Colin Barker, Apr 07 2015
Showing 1-7 of 7 results.
Comments