Split Equally

1 0 2 0 3 0 0 63 0 64 = 0 1\; \boxed{\phantom0} \; 2 \; \boxed{\phantom0}\; 3 \; \boxed{\phantom0} \; \cdots \; \boxed{\phantom0}\; 63 \; \boxed{\phantom0} \; 64 = 0

Filling in each of these boxes with either a + + or a , -, how many ways can we make this equality hold?

Note: This is intended to be a programming problem.


The answer is 24435006625667338.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Mark Hennings
Jul 23, 2018

For any arrangement of signs, let P P be the set of numbers given the symbol + + , and let N N be the set of numbers given the symbol - . Then P P and N N are disjoint subsets of { 2 , 3 , . . . , 64 } \{2,3,...,64\} whose union is { 2 , 3 , . . . , 64 } \{2,3,...,64\} , and 1 + n P n + n N n = 1 + 2 + + 64 = 2080 1 + n P n n N n = 0 1 + \sum_{n \in P}n + \sum_{n \in N}n \; = \; 1 + 2 + \cdots + 64 = 2080 \hspace{2cm} 1 + \sum_{n \in P}n - \sum_{n \in N}n \; = \; 0 and hence 1 + n P n = n N n = 1040 1 + \sum_{n \in P}n \; = \; \sum_{n \in N}n \; = \; 1040 and hence we need to count the number of subsets P P of { 2 , 3 , . . . , 64 } \{2,3,...,64\} such that n P n = 1039 \sum_{n \in P}n = 1039 . Thus we want the coefficient of x 1039 x^{1039} in the product k = 2 64 ( 1 + x k ) \prod_{k=2}^{64}(1+ x^k) The Mathematica command

SeriesCoefficient[Product[1 + x^k,{k,2,64}],{x,0,1039}]

gives us the answer 24435006625667338 \boxed{24435006625667338} .

Simpson Eng
Sep 14, 2018

Here's a C++ code of mine to it. Simply bottom-up dynamic programming.

Click here for code

please explain your code little bit....how u got this approach...

Amrit Anand - 2 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...