OFFSET
1,2
COMMENTS
Column 2 of A183935.
From David A. Corneth, Oct 21 2017: (Start)
Let x_i be the number of numbers in such an arrangement with |i| = 2. Then x_1 + 4*x_2 < 2*n and x_1 is even, x_1 + x_2 != 1.
A pair (x_1, x_2) has a fixed number of arrangements corresponding to it, independent of the number of zeros in the arrangement, hence independent of n. For example, for (x_1, x_2) = (2, 1), we could find the arrangements (-1, -1, 2) and (-2, 1, 1) and from there on find some solutions counted in n = 4 (see example below) by putting an extra 0 to each arrangement to find (-1, -1, 0, 2) and (-2, 0, 1, 1).
For some n, we might find that (x_1, x_2) is feasible by the restrictions above. If all those 1's and 2's are signed positive, their sums become S = x_1 + 2 * x_2. We then change signs of 1's and 2's such that the sum of all terms is 0. If we change the sign of 1 from + to -, the total is reduced by 2 * 1 = 2. Similarily, if we change the sign of 2 from + to -, we reduce the total by 2*2 = 4. Let s_i be the number of i's whose signs we change from + to -, x_i - s_i, s_i >= 0. So the sum S must be even. We get the new sum 0 = (x_1 - 2*s_1) + (2 * x_2 - 2*s_2) = x_1 + 2 * x_2 - 2 * (s_1 + s_2) = S - 2 * (s_1 + s_2). I.e., s_1 + s_2 = S/2, which is a Diophantine equation. Note that the solution to this equation can be used for computation of various values of a(n). See the example for an application.
(End)
LINKS
David A. Corneth, Table of n, a(n) for n = 1..2000
FORMULA
Empirical: a(n) = a(n-1)+2*a(n-3)-a(n-4)-a(n-5)-a(n-6)-a(n-7)+2*a(n-8)+a(n-10)-a(n-11).
Empirical g.f.: x*(1 + x + x^3 + x^5) / ((1 - x)^4*(1 + x)*(1 + x^2)*(1 + x + x^2)^2). - Colin Barker, Oct 21 2017
EXAMPLE
All solutions for n=4:
-1 0 -2 -1 -1
0 0 0 -1 -1
0 0 1 0 1
1 0 1 2 1
Suppose we try to find a(6) and see that (0, 0, 1, 1, 2, 2) has sum of squares <= 2*6 = 12. This corresponds to x_1 = x_2 = 2 and gives S = x_1 + 2*x_2 = 2 + 2*2 = 6. We change signs so that s_1 + 2*s_2 = S/2 = 6/2 = 3, with s_1, s_2 in {0, 1, 2}. We see that (s_1, s_2) in {(1, 1)} so the only solution for this is (0, 0, -1, 1, -2, 2) which is (-2, -1, 0, 0, 1, 2) when sorted. - David A. Corneth, Oct 24 2017
PROG
(PARI) a(n) = {my(res = 0); for(x_2 = 0, (2*n - 1) \ 4, forstep(x_1 = 0, min(2*n - 4 * x_2 - 1, n), 2, if(x_1 + x_2 != 1 && x_1 + x_2 <= n && !(x_1 == 0 && x_2%2 == 1), res += (2 * (min((x_1 - 2*(x_2%2))\4, x_2\2) + 1) - !(x_2%2))))); res} \\ David A. Corneth, Oct 24 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Jan 08 2011
STATUS
approved