login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A183928 Number of nondecreasing arrangements of n numbers in -2..2 with sum zero and sum of squares less than 2n. 1

%I #36 Apr 11 2018 23:41:31

%S 1,2,2,5,8,10,15,21,26,35,44,53,67,81,94,114,134,153,179,206,232,266,

%T 300,334,377,420,462,515,568,620,683,747,810,885,960,1035,1123,1211,

%U 1298,1400,1502,1603,1719,1836,1952,2084,2216,2348,2497,2646,2794,2961,3128

%N Number of nondecreasing arrangements of n numbers in -2..2 with sum zero and sum of squares less than 2n.

%C Column 2 of A183935.

%C From _David A. Corneth_, Oct 21 2017: (Start)

%C 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.

%C 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).

%C 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.

%C (End)

%H David A. Corneth, <a href="/A183928/b183928.txt">Table of n, a(n) for n = 1..2000</a>

%F 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).

%F 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

%e All solutions for n=4:

%e -1 0 -2 -1 -1

%e 0 0 0 -1 -1

%e 0 0 1 0 1

%e 1 0 1 2 1

%e 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

%o (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

%Y Cf. A183935.

%K nonn

%O 1,2

%A _R. H. Hardin_, Jan 08 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 12:44 EDT 2024. Contains 371913 sequences. (Running on oeis4.)