%I #90 Aug 16 2021 13:43:17
%S 1,0,0,2,2,0,0,8,14,0,0,70,124,0,0,722,1314,0,0,8220,15272,0,0,99820,
%T 187692,0,0,1265204,2399784,0,0,16547220,31592878,0,0,221653776,
%U 425363952,0,0,3025553180,5830034720,0,0,41931984034,81072032060,0,0
%N Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0.
%C Number of sum partitions of the half of the n-th-triangular number by distinct numbers in the range 1 to n. Example: a(7)=8 since triangular(7)=28 and 14 = 2+3+4+5 = 1+3+4+6 = 1+2+5+6 = 3+5+6 = 7+1+2+4 = 7+3+4 = 7+2+5 = 7+1+6. - _Hieronymus Fischer_, Oct 20 2010
%C The asymptotic formula below was stated as a conjecture by Andrica & Tomescu in 2002 and proved by B. D. Sullivan in 2013. See his paper and H.-K. Hwang's review MR 2003j:05005 of the JIS paper. - _Jonathan Sondow_, Nov 11 2013
%C a(n) is the number of subsets of {1..n} whose sum is equal to the sum of their complement. See example below. - _Gus Wiseman_, Jul 04 2019
%H T. D. Noe, N. J. A. Sloane and Ray Chandler, <a href="/A063865/b063865.txt">Table of n, a(n) for n = 0..3339</a> (terms < 10^1000, first 101 terms from T. D. Noe, next 300 terms from N. J. A. Sloane)
%H Dorin Andrica and Ovidiu Bagdasar, <a href="https://doi.org/10.1007/s11139-021-00418-7">On k-partitions of multisets with equal sums</a>, The Ramanujan J. (2021) Vol. 55, 421-435.
%H Dorin Andrica, Ovidiu Bagdasar, and George Cătălin Ţurcaş, <a href="https://doi.org/10.1007/978-3-030-55857-4_3">The Number of Partitions of a Set and Superelliptic Diophantine Equations</a>, Disc. Math. and Applications, Springer, Cham (2020), 35-55.
%H D. Andrica and E. J. Ionascu, <a href="http://www.dorinandrica.ro/files/presentation-INTEGERS-2013.pdf">Variations on a result of Erdős and Surányi</a>, INTEGERS 2013 slides.
%H D. Andrica and I. Tomescu, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL5/Tomescu/tomescu4.html">On an Integer Sequence Related to a Product of Trigonometric Functions, and Its Combinatorial Relevance</a>, J. Integer Seq., 5 (2002), Article 02.2.4
%H Ovidiu Bagdasar and Dorin Andrica, <a href="https://dx.doi.org/10.1109/ICMSAO.2017.7934928">New results and conjectures on 2-partitions of multisets</a>, 2017 7th International Conference on Modeling, Simulation, and Applied Optimization (ICMSAO).
%H Steven R. Finch, <a href="/A000980/a000980.pdf">Signum equations and extremal coefficients</a>, February 7, 2009. [Cached copy, with permission of the author]
%H B. D. Sullivan, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL16/Sullivan/sullivan8.html">On a Conjecture of Andrica and Tomescu</a>, J. Int. Sequences, 16 (2013), Article 13.3.1.
%H zbMATH, <a href="http://zbmath.org/?q=an:1012.05006">Review of Andrica and Tomescu</a>
%F Asymptotic formula: a(n) ~ sqrt(6/Pi)*n^(-3/2)*2^n for n = 0 or 3 (mod 4) as n approaches infinity.
%F a(n) = 0 unless n == 0 or 3 (mod 4).
%F a(n) = constant term in expansion of Product_{ k = 1..n } (x^k + 1/x^k). - _N. J. A. Sloane_, Jul 07 2008
%F If n = 0 or 3 (mod 4) then a(n) = coefficient of x^(n(n+1)/4) in Product_{k=1..n} (1+x^k). - D. Andrica and I. Tomescu.
%F a(n) = 2*A058377(n) for any n > 0. - _Rémy Sigrist_, Oct 11 2017
%e From _Gus Wiseman_, Jul 04 2019: (Start)
%e For example, the a(0) = 1 through a(8) = 14 subsets (empty columns not shown) are:
%e {} {3} {1,4} {1,6,7} {3,7,8}
%e {1,2} {2,3} {2,5,7} {4,6,8}
%e {3,4,7} {5,6,7}
%e {3,5,6} {1,2,7,8}
%e {1,2,4,7} {1,3,6,8}
%e {1,2,5,6} {1,4,5,8}
%e {1,3,4,6} {1,4,6,7}
%e {2,3,4,5} {2,3,5,8}
%e {2,3,6,7}
%e {2,4,5,7}
%e {3,4,5,6}
%e {1,2,3,4,8}
%e {1,2,3,5,7}
%e {1,2,4,5,6}
%e (End)
%p M:=400; t1:=1; lprint(0,1); for n from 1 to M do t1:=expand(t1*(x^n+1/x^n)); lprint(n, coeff(t1,x,0)); od: # _N. J. A. Sloane_, Jul 07 2008
%t f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[ n-1, s-n]+f[n-1, s+n]]; a[n_] := f[n, 0]
%t nmax = 50; d = {1}; a1 = {};
%t Do[
%t i = Ceiling[Length[d]/2];
%t AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
%t d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n];
%t , {n, nmax}];
%t a1 (* _Ray Chandler_, Mar 13 2014 *)
%o (PARI) a(n)=my(x='x); polcoeff(prod(k=1,n,x^k+x^-k)+O(x),0) \\ _Charles R Greathouse IV_, May 18 2015
%o (PARI) a(n)=0^n+floor(prod(k=1,n,2^(n*k)+2^(-n*k)))%(2^n) \\ _Tani Akinari_, Mar 09 2016
%Y Cf. A000980, A025591, A058377, A063866, A063867, A113036, A113037, A141000.
%Y "Decimations": A060468 = 2*A060005, A123117 = 2*A104456.
%Y Analogous sequences for sums of squares and cubes are A158092, A158118, see also A019568. - _Pietro Majer_, Mar 15 2009
%Y Cf. A053632, A059529, A326173, A326174, A326175.
%K nonn,easy,nice
%O 0,4
%A _N. J. A. Sloane_, suggested by _J. H. Conway_, Aug 27 2001
%E More terms from _Dean Hickerson_, Aug 28 2001
%E Corrected and edited by _Steven Finch_, Feb 01 2009