Finite Summation = Perfect Square

Find the sum of all positive integers n 1000 n\leq 1000 such that the double sum i = 1 n j = 1 n ( i j ) 2 \begin{aligned} \sum_{i=1}^n\sum_{j=1}^n (i-j)^2 \end{aligned} is a perfect square.


The answer is 540.

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

Patrick Corn
Aug 11, 2014

By expanding out and using the well-known formulas for the sum of the first n n integers and the first n n squares, we get that the sum is 2 n k 2 2 ( k ) 2 = n 2 ( n 2 1 ) / 6 2n \sum k^2 - 2\left( \sum k \right)^2 = n^2(n^2-1)/6 .

If this is a square, then ( n 2 1 ) / 6 (n^2-1)/6 is a rational square. But since the denominator has no square factors, this implies that ( n 2 1 ) / 6 (n^2-1)/6 is a square integer.

Solving n 2 6 m 2 = 1 n^2-6m^2=1 by whatever your favorite Pell's equation method is, we see that n + m 6 n+m\sqrt{6} is a power of 5 + 2 6 5+2\sqrt{6} . This leads to solutions 1 , 5 , 49 , 485 , 4801 , 1, 5, 49, 485, 4801, \ldots , so the answer is 540 \fbox{540} .

Ah dang, you beat me to writing a solution. I took too long to realize I was missing the n = 1 n=1 trivial solution.

Daniel Liu - 6 years, 10 months ago

Log in to reply

For me, I didn't realize it said sum :D

Michael Tong - 6 years, 10 months ago

Yup. Also forgot n=1

Humberto Bento - 6 years, 8 months ago

brilliant!!!

Vibhor Chandak - 2 years ago
Cody Johnson
Aug 11, 2014

First math out the sum to get n 2 ( n 2 1 ) 6 = x 2 \frac{n^2(n^2-1)}6=x^2 . Since gcd ( n 2 , n 2 1 ) = 1 \gcd(n^2,n^2-1)=1 , we know that 2 ∤ n 2 2\not\mid n^2 because then there is an odd number of even numbers dividing x 2 x^2 . Similarly, 3 ∤ n 2 3\not\mid n^2 . Hence, n x n\mid x . We can thus rewrite as n 2 6 ( x n ) 2 = 1 n^2-6\left(\frac{x}n\right)^2=1 , where both n n and x n \frac{x}n are integers. This is just Pell's equation! Since ( n , x n ) = ( 5 , 2 ) \left(n,\frac{x}n\right)=(5,2) satisfies it, we have n i = 10 n i 1 n i 2 n_i=10n_{i-1}-n_{i-2} with n 0 = 1 n_0=1 and n 1 = 5 n_1=5 . Hence, n 2 = 49 n_2=49 and n 3 = 485 n_3=485 , with no more solutions n 1000 n\le1000 . Hence, 1 + 5 + 49 + 485 = 540 1+5+49+485=\boxed{540} . Very nice problem, I'm surprised Pell's equation came up. Love it!

I have ran an java program to check the solutions.

Ronak Agarwal - 6 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...