|
Search: id:A058377
|
|
|
| A058377 |
|
Number of solutions to 1 +- 2 +- 3 +- ... +- n = 0. |
|
+0 12
|
|
| 0, 0, 1, 1, 0, 0, 4, 7, 0, 0, 35, 62, 0, 0, 361, 657, 0, 0, 4110, 7636, 0, 0, 49910, 93846, 0, 0, 632602, 1199892, 0, 0, 8273610, 15796439, 0, 0, 110826888, 212681976, 0, 0, 1512776590, 2915017360, 0, 0, 20965992017, 40536016030, 0, 0, 294245741167
(list; graph; listen)
|
|
|
OFFSET
|
1,7
|
|
|
COMMENT
|
Consider the set { 1,2,3,...,n }. Sequence gives number of ways this set can be partitioned into 2 subsets with equal sums. For example, when n = 7, { 1,2,3,4,5,6,7} can be partitioned in 4 ways: {1,6,7} {2,3,4,5}; {2,5,7} {1,3,4,6}; {3,4,7} {1,2,5,6} and {1,2,4,7} {3,5,6}. - sorin (yamba_ro(AT)yahoo.com), Mar 24 2007
|
|
FORMULA
|
a(n) is half the coefficient of q^0 in product('(q^(-k)+q^k)', 'k'=1..n) for n >= 1. - Floor van Lamoen (fvlamoen(AT)hotmail.com), Oct 10 2005
a(4n+1) = a(4n+2) = 0. - Michael Somos Apr 15 2007
|
|
EXAMPLE
|
1+2-3=0, so a(3)=1; 1-2-3+4=0, so a(4)=1; 1+2-3+4-5-6+7=0, 1+2-3-4+5+6-7=0, 1-2+3+4-5+6-7=0, 1-2-3-4-5+6+7=0, so a(7)=4.
|
|
MATHEMATICA
|
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]]; Table[ f[n, 0]/2, {n, 1, 50}]
|
|
CROSSREFS
|
Cf. A069918, A025591, A063865, A063866, A063867, A111133.
Sequence in context: A146294 A133982 A069179 this_sequence A023961 A147863 A019976
Adjacent sequences: A058374 A058375 A058376 this_sequence A058378 A058379 A058380
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Naohiro Nomoto (6284968128(AT)geocities.co.jp), Dec 19 2000
|
|
EXTENSIONS
|
More terms from Sascha Kurz (sascha.kurz(AT)uni-bayreuth.de), Mar 25 2002
Edited and extended by Robert G. Wilson v (rgwv(AT)rgwv.com), Oct 24 2002
|
|
|
Search completed in 0.002 seconds
|