Sum of squares

Find the smallest integer a > 1 a>1 such that: i = 1 a i 2 = N 2 \large \sum_{i=1}^{a} i^2 =N^2 where N N is an integer.


The answer is 24.

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.

4 solutions

Jon Haussmann
Jun 1, 2016

This is the Cannonball problem . The only solutions ( a , N ) (a,N) are (1,1) and (24,70).

Alex Spagnoletti
Jun 10, 2016

My solution. Use the fact that the sum of consecutive squares from 1 1 to n n is n ( n + 1 ) ( 2 n + 1 ) 6 \dfrac{n(n+1)(2n+1)}{6} . Now this must be a square, x 2 x^2 . Rewrite it as n ( n + 1 ) ( 2 n + 1 ) = 6 x 2 n(n+1)(2n+1)=6x^2 Now multiplying the two parenthesis we obtain n ( 2 n 2 + 3 n + 1 ) = 6 x 2 n(2n^2+3n+1)=6x^2 . The g c d ( n , 2 n 2 + 3 n + 1 ) = 1 gcd(n,2n^2+3n+1)=1 so let's say that 6 n n = 6 k 6\mid n \implies n=6k . By substitution in the original equation we obtain k ( 6 k + 1 ) ( 12 k + 1 ) = x 2 k(6k+1)(12k+1)=x^2 now all three terms must be perfect squares because they are all coprimes (proved easily thanks to Euclidean algorithm). The smallest value that makes this true is k = 4 n = 6 × 4 = 24 k=4 \implies n=6\times4=24 so the smalles solution is n = 24 n=24 and thus x = 70 x=70 .

Python 3.5.1:

def issquare(n):
    if n**0.5==round(n**0.5):
        return True
count=2
while not issquare(sum(i**2 for i in range(1,count+1))):
    count+=1

print (count)
Rishabh Tiwari
Jun 3, 2016

Is there any approach to this question using pure number theory? Please comment.!

I am not totally sure. This was a problem posed to me that I solved by guess and check. I was wondering if there was a better solution, so I posted it on Brilliant.

My solution: Sum of squares is:

n ( n + 1 ) ( 2 n + 1 ) 6 \dfrac{n(n+1)(2n+1)}{6}

Now for a big assumption: two of the three terms in the multiplication in the numerator are perfect squares, the other is 6 times a perfect square. This is a big assumption, and in no way justified, although it limits the possible values of n and it is an intuitive leap of logic: if these conditions are satisfied, then the sum will be a perfect square. Checking n = 6 , n + 1 = 6 , o r 2 n + 1 = 6 n=6, n+1=6, or 2n+1=6 , none works (it is checked easily as 5 and 7 are not perfect squares, and if 2 n + 1 = 6 2n+1=6 then n is not an integer). Now we jump to 24. Note that 24 + 1 24+1 is a perfect square, so it is natural to assign n = 24 n=24 . Checking this condition we see it works.

My logic is mostly guess work, and in no way a good solution to the problem.

It is possible this problem should be a computer science problem.

Alex G - 5 years ago

Log in to reply

Ok I got it , why don't you repost it, maybe the seniors will view & solve it this time (if possible) , Btw nice question & nice logic ! I also did it by hit nd trial !

Rishabh Tiwari - 5 years ago

Look at my solution.

Alex Spagnoletti - 5 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...