A201552
Square array read by diagonals: T(n,k) = number of arrays of n integers in -k..k with sum equal to 0.
Original entry on oeis.org
1, 1, 3, 1, 5, 7, 1, 7, 19, 19, 1, 9, 37, 85, 51, 1, 11, 61, 231, 381, 141, 1, 13, 91, 489, 1451, 1751, 393, 1, 15, 127, 891, 3951, 9331, 8135, 1107, 1, 17, 169, 1469, 8801, 32661, 60691, 38165, 3139, 1, 19, 217, 2255, 17151, 88913, 273127, 398567, 180325, 8953, 1
Offset: 1
Some solutions for n=7, k=3:
..1...-2....1...-1....1...-3....0....0....1....2....3...-3....0....2....1....0
.-1....2...-2....2....2....2...-1....0....2....2...-2...-1...-2...-1....2...-1
.-3...-1....1...-3....2....1....0....1....3....0....2....0...-1....2...-2...-1
..0....3....3....3...-2...-2....3....3...-3...-3....0...-1...-1...-1....0....3
..2...-1...-1...-1...-3....0...-3...-2....1...-1...-1....1....1....0....3...-1
..2...-1...-3....0....2....3....0....1...-2....1....1....1....3...-2...-3...-3
.-1....0....1....0...-2...-1....1...-3...-2...-1...-3....3....0....0...-1....3
Table starts:
. 1, 1, 1, 1, 1, 1,...
. 3, 5, 7, 9, 11, 13,...
. 7, 19, 37, 61, 91, 127,...
. 19, 85, 231, 489, 891, 1469,...
. 51, 381, 1451, 3951, 8801, 17151,...
. 141, 1751, 9331, 32661, 88913, 204763,...
. 393, 8135, 60691, 273127, 908755, 2473325,...
.1107, 38165, 398567, 2306025, 9377467, 30162301,...
.3139, 180325, 2636263, 19610233, 97464799, 370487485,...
-
seq(print(seq(add((-1)^i*binomial(n, i)*binomial((k+1)*n-(2*k+1)*i-1, n-1), i = 0..floor((1/2)*n)), k = 1..10)), n = 1..10); # Peter Bala, Oct 16 2024
-
comps[r_, m_, k_] := Sum[(-1)^i*Binomial[r - 1 - i*m, k - 1]*Binomial[k, i], {i, 0, Floor[(r - k)/m]}]; T[n_, k_] := comps[n*(k + 1), 2*k + 1, n]; Table[T[n - k + 1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 31 2017, after Andrew Howroyd *)
-
comps(r, m, k)=sum(i=0, floor((r-k)/m), (-1)^i*binomial(r-1-i*m, k-1)*binomial(k, i));
T(n,k) = comps(n*(k+1), 2*k+1, n); \\ Andrew Howroyd, Oct 14 2017
A208597
T(n,k) = number of n-bead necklaces labeled with numbers -k..k not allowing reversal, with sum zero.
Original entry on oeis.org
1, 1, 2, 1, 3, 3, 1, 4, 7, 6, 1, 5, 13, 23, 11, 1, 6, 21, 60, 77, 26, 1, 7, 31, 125, 291, 297, 57, 1, 8, 43, 226, 791, 1564, 1163, 142, 1, 9, 57, 371, 1761, 5457, 8671, 4783, 351, 1, 10, 73, 568, 3431, 14838, 39019, 49852, 20041, 902, 1, 11, 91, 825, 6077, 34153, 129823
Offset: 1
Table starts
...1....1.....1......1.......1.......1........1........1........1.........1
...2....3.....4......5.......6.......7........8........9.......10........11
...3....7....13.....21......31......43.......57.......73.......91.......111
...6...23....60....125.....226.....371......568......825.....1150......1551
..11...77...291....791....1761....3431.....6077....10021....15631.....23321
..26..297..1564...5457...14838...34153....69784...130401...227314....374825
..57.1163..8671..39019..129823..353333...833253..1764925..3438877...6267735
.142.4783.49852.288317.1172298.3770475.10259448.24627705.53630854.108036775
-
comps[r_, m_, k_] := Sum[(-1)^i*Binomial[r-1-i*m, k-1]*Binomial[k, i], {i, 0, Floor[(r-k)/m]}]; a[n_, k_] := DivisorSum[n, EulerPhi[n/#] comps[#*(k + 1), 2k+1, #]&]/n; Table[a[n-k+1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 07 2017, after Andrew Howroyd's PARI code *)
-
comps(r,m,k)=sum(i=0,floor((r-k)/m),(-1)^i*binomial(r-1-i*m, k-1)*binomial(k, i));
a(n,k)=sumdiv(n,d,eulerphi(n/d)*comps(d*(k+1), 2*k+1, d))/n;
for(n=1,8,for(k=1,10,print1(a(n,k),", ")); print()); \\ Andrew Howroyd, May 16 2017
-
from sympy import binomial, divisors, totient, floor
def comps(r, m, k): return sum([(-1)**i*binomial(r - 1 - i*m, k - 1)*binomial(k, i) for i in range(floor((r - k)/m) + 1)])
def a(n, k): return sum([totient(n//d)*comps(d*(k + 1), 2*k + 1, d) for d in divisors(n)])//n
for n in range(1, 12): print([a(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Nov 07 2017, after PARI code
-
require(numbers)
comps <- function(r, m, k) {
S <- numeric()
for (i in 0:floor((r-k)/m)) S <- c(S, (-1)^i*choose(r-1-i*m, k-1)*choose(k, i))
return(sum(S))
}
a <- function(n, k) {
S <- numeric()
for (d in divisors(n)) S <- c(S, eulersPhi(n/d)*comps(d*(k+1), 2*k+1, d))
return(sum(S)/n)
}
for (n in 1:11) {
for (k in 1:n) {
print(a(k,n-k+1))
}
} # Indranil Ghosh, Nov 07 2017, after PARI code
A318793
Constant term in the expansion of (Sum_{k=0..n} k*(x^k + x^(-k)))^n.
Original entry on oeis.org
1, 0, 10, 84, 12060, 922680, 203474180, 45546045720, 16977056982648, 7385901628225968, 4359210462435545640, 3063111491275816418020, 2669859570203387710219500, 2738752987417403052110951664, 3328615281192062743163487239944
Offset: 0
(2/x^2 + 1/x + 0 + x + 2*x^2)^2 = 4/x^4 + 4/x^3 + 1/x^2 + 4/x + 10 + 4*x + x^2 + 4*x^3 + 4*x^4. So a(2) = 10.
-
a[n_] := If[n==0, 1, Coefficient[Expand[Sum[k*(x^k + x^(-k)), {k, 0, n}]^n], x, 0]]; Array[a, 15, 0] (* Amiram Eldar, Dec 15 2018 *)
-
{a(n) = polcoeff((sum(k=0, n, k*(x^k+x^(-k))))^n, 0, x)}
A329076
Constant term in the expansion of ((Sum_{k=-n..n} x^k) * (Sum_{k=-n..n} y^k) - (Sum_{k=-n+1..n-1} x^k) * (Sum_{k=-n+1..n-1} y^k))^n.
Original entry on oeis.org
1, 0, 16, 72, 7008, 162000, 17555520, 1093527120, 140846184640, 16016249944800, 2550757928818680, 419682645514181280, 82389928294166805312, 17418502084657134228768, 4123280170924828458697152, 1054943518137131171386437600, 293933660095874311773617934720, 87968971083026619734709639853632
Offset: 0
-
{a(n) = polcoef(polcoef((sum(k=-n, n, x^k)*sum(k=-n, n, y^k)-sum(k=-n+1, n-1, x^k)*sum(k=-n+1, n-1, y^k))^n, 0), 0)}
-
{a(n) = polcoef(polcoef((sum(k=0, 2*n, (x^k+1/x^k)*(y^(2*n-k)+1/y^(2*n-k)))-x^(2*n)-1/x^(2*n)-y^(2*n)-1/y^(2*n))^n, 0), 0)}
-
f(n) = (x^(n+1)-1/x^n)/(x-1);
a(n) = sum(k=0, n, (-1)^(n-k)*binomial(n, k)*polcoef(f(n)^k*f(n-1)^(n-k), 0)^2)
A160492
a(n) = number of solutions to an equation x_1 + ... + x_j =0 with 1<=j<=n satisfying -n<=x_i<=n (1<=i<=j).
Original entry on oeis.org
1, 6, 45, 560, 9795, 223524, 6284089, 210208560, 8156750283, 360297117070, 17853149451841, 980844453593160, 59179098916735213, 3890176308574524934, 276750779199166606705, 21185250061147839785120, 1736385140876356212244563, 151719500906542020597450498
Offset: 1
From _Andrew Howroyd_, May 16 2017 (Start)
Case n=3:
1 variable: {0} is only solution.
2 variables: {-3,3}, {-2,2}, {-1,1}, {0,0}, {1,-1}, {2,-2}, {3,-3}.
3 variables: {-3 0 3}x6, {-3 1 2}x6, {-2 -1 3}x6, {-2 0 2}x6,
{-2 1 1}x3, {-1 -1 2}x3, {-1 0 1}x6, {0 0 0}x1
In the above, {-3 0 3}x6 means that the values can be expanded to 6 solutions by considering different orderings.
In total there are 1 + 7 + 37 = 45 solutions so a(3)=45.
(End)
-
zerocompositionswithzero[p_] := Module[{united = {}, i, zerosums = {}, count = 0}, For[i = 1, i <= p, i = i + 1, united = Union[united, Tuples[Table[x, {x, -p, p}], i]] ]; For[i = 1, i <= Length[united], i = i + 1, If[Sum[united[[i, j]], {j, 1, Length[united[[i]]]}] == 0, zerosums = Append[zerosums, united[[i]]]; count = count + 1;]; ]; Return[{count, zerosums}]; ];
-
\\ nr compositions of r with max value m into exactly k parts.
compositions(r,m,k)=sum(i=0,floor((r-k)/m),(-1)^i*binomial(r-1-i*m, k-1)*binomial(k, i));
a(n)=sum(v=1,n,compositions(v*(n+1),2*n+1,v)); \\ Andrew Howroyd, May 16 2017
-
from sympy import binomial
def C(r, m, k): return sum([(-1)**i*binomial(r - 1 - i*m, k - 1)*binomial(k, i) for i in range(int((r - k)/m) + 1)])
def a(n): return sum([C(v*(n + 1), 2*n + 1, v) for v in range(1, n + 1)]) # Indranil Ghosh, May 16 2017, after the PARI program by Andrew Howroyd
A322514
a(n) = [x^(n^2)] (Sum_{k=0..2*n} (k+1)*x^k)^n.
Original entry on oeis.org
1, 2, 35, 1624, 169653, 30961656, 8792309747, 3592089777760, 1998565555891049, 1454040182726241040, 1340732073013968993771, 1528443066775450331625912, 2111332024387378632991315275, 3475577885419591506890414078832
Offset: 0
-
f[n_] := Coefficient[Expand[Sum[(k+1)*x^k ,{k, 0, 2n}]^n, x], x, n^2]; Array[f, 15, 0] (* Amiram Eldar, Dec 13 2018 *)
-
{a(n) = polcoeff((sum(k=0, 2*n, (k+1)*x^k))^n, n^2, x)}
Showing 1-6 of 6 results.
Comments