Find the number of quadruplets of non-negative integers satisfying
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.
Let's build up to the full problem. Below, a 1 , a 2 , a 3 , a 4 will always be non-negative integers (the summands); n will be a non-negative integer target. Let f k ( n ) be the number of solutions to the equation a 1 + ⋯ + a k = n .
Clearly, f 1 ( n ) = 1 .
How many solutions are there to a 1 + a 2 = n ? We can pick any value from 0 to n inclusive for a 1 , and then a 2 = n − a 1 will work; so f 2 ( n ) = n + 1 .
By extending this logic we find, in general, f k ( n ) = r = 0 ∑ n f k − 1 ( n − r ) = r = 0 ∑ n f k − 1 ( r )
So f 3 ( n ) = 2 1 ( n + 1 ) ( n + 2 ) .
For example, there are 2 3 1 solutions to a 1 + a 2 + a 3 = 2 0 .
How does this help with a + b + c + 4 d = 2 0 ? Well, note that 0 ≤ d ≤ 5 ; we can just rewrite the equation as a + b + c = 2 0 − 4 d and use the above result to find the number of solutions is f 3 ( 2 0 ) + f 3 ( 1 6 ) + f 3 ( 1 2 ) + ⋯ + f 3 ( 0 ) = 2 3 1 + 1 5 3 + 9 1 + 4 5 + 1 5 + 1 = 5 3 6 .
In general, the number of solutions to a + b + c + 4 d = 4 m is given by d = 0 ∑ m f 3 ( 4 d ) = 3 1 ( 1 + m ) ( 3 + 1 3 m + 8 m 2 )
Some bonus questions:
what if the target n is not a multiple of 4 ?
can you find a closed formula for the number of solutions to a + b + c + 4 d = n for all non-negative n ?
are these formulas always polynomials?
if so, what degree are these polynomials, and why?