OFFSET
1,2
COMMENTS
The number of variables in the equation can be from 1 to n and each variable can have a value of -n to n. See A286928 for the case of exactly n variables. - Andrew Howroyd, May 16 2017
FORMULA
a(n) = Sum_{k=1..n} Sum_{i=0..floor(k/2)} (-1)^i*binomial(k*(n+1)-i*(2*n+1)-1, k-1)*binomial(k, i). - Andrew Howroyd, May 16 2017
EXAMPLE
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)
MATHEMATICA
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}]; ];
PROG
(PARI)
\\ 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
(Python)
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Srikanth K S, May 15 2009
EXTENSIONS
Name clarified and a(6)-a(18) from Andrew Howroyd, May 16 2017
STATUS
approved