Find the sum of all positive integers n ≤ 1 0 0 0 such that the double sum i = 1 ∑ n j = 1 ∑ n ( i − j ) 2 is a perfect square.
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.
Ah dang, you beat me to writing a solution. I took too long to realize I was missing the n = 1 trivial solution.
Yup. Also forgot n=1
brilliant!!!
First math out the sum to get 6 n 2 ( n 2 − 1 ) = x 2 . Since g cd ( n 2 , n 2 − 1 ) = 1 , we know that 2 ∣ n 2 because then there is an odd number of even numbers dividing x 2 . Similarly, 3 ∣ n 2 . Hence, n ∣ x . We can thus rewrite as n 2 − 6 ( n x ) 2 = 1 , where both n and n x are integers. This is just Pell's equation! Since ( n , n x ) = ( 5 , 2 ) satisfies it, we have n i = 1 0 n i − 1 − n i − 2 with n 0 = 1 and n 1 = 5 . Hence, n 2 = 4 9 and n 3 = 4 8 5 , with no more solutions n ≤ 1 0 0 0 . Hence, 1 + 5 + 4 9 + 4 8 5 = 5 4 0 . Very nice problem, I'm surprised Pell's equation came up. Love it!
I have ran an java program to check the solutions.
Problem Loading...
Note Loading...
Set Loading...
By expanding out and using the well-known formulas for the sum of the first n integers and the first n squares, we get that the sum is 2 n ∑ k 2 − 2 ( ∑ k ) 2 = n 2 ( n 2 − 1 ) / 6 .
If this is a square, then ( n 2 − 1 ) / 6 is a rational square. But since the denominator has no square factors, this implies that ( n 2 − 1 ) / 6 is a square integer.
Solving n 2 − 6 m 2 = 1 by whatever your favorite Pell's equation method is, we see that n + m 6 is a power of 5 + 2 6 . This leads to solutions 1 , 5 , 4 9 , 4 8 5 , 4 8 0 1 , … , so the answer is 5 4 0 .