Any larger pairs after this?

1 + 2 + + 10 = 1 2 + 2 2 + + 5 2 1 + 2 + + 13 = 1 2 + 2 2 + + 6 2 \begin{aligned} 1 + 2 + \cdots + 10 &= 1^2 + 2^2 + \cdots + 5^2\\ 1 + 2 + \cdots + 13 &= 1^2 + 2^2 + \cdots + 6^2 \\ &\vdots \end{aligned}

Find the next pair of integers ( M , N ) (M,N) larger than ( 13 , 6 ) (13,6) such that 1 + 2 + + M = 1 2 + 2 2 + + N 2 . 1 + 2 + \cdots +M= 1^2 + 2^2 + \cdots + N^2. Submit your answer as M + N M+N .


The answer is 730.

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.

7 solutions

Naren Bhandari
Feb 6, 2018

The most of credit for this solution goes to @Avishek Yadav as he aided me to get the idea of discriminant D D must be equal to 3 Y 2 3Y^2 1 + 2 + + M = 1 2 + 2 2 + + N 2 M ( M + 1 ) 2 = N ( N + 1 ) ( 2 N + 1 ) 6 3 M 2 + 3 M N ( N + 1 ) ( 2 N + 1 ) = 0 M = 3 ± 3 ( 8 N 3 + 12 N 2 + 4 N + 3 ) 6 \begin{aligned} & 1+2+\cdots + M = 1^2+2^2+\cdots + N^2 \\& \frac{M(M+1)}{2} = \frac{N(N+1)(2N+1)}{6} \\& 3M^2 +3M -N(N+1)(2N+1) = 0 \\ & M = \frac{-3 \pm\sqrt{3 (8N^3+12N^2 +4N+3)}}{6} \end{aligned} Now noting the discriminant of above equation D = 8 N 3 + 12 N 2 + 4 N + 3 = 8 ( N + 1 2 ) 3 2 ( N + 1 2 ) + 3 = X 3 X + 3 c c c c c c let x = 2 ( N + 1 2 ) \begin{aligned} & D = 8N^3+ 12N^2 +4N +3 \\& = 8\left(N+\frac{1}{2}\right)^3- 2\left(N+\frac{1}{2}\right)+3 \\ & = X^3 -X +3 \phantom{cccccc} \text{let x} = 2\left(N+\frac{1}{2}\right)\end{aligned} It is vivid that discriminant D D in the above equation will be perfect square iff D = 3 Y 2 X 3 X + 3 = 3 Y 2 ( a ) \begin{aligned} & D = 3Y^2 \\ & X^3 -X+3 = 3Y^2 \cdots(a)\end{aligned} The solution of equations a a has been provided by Saburô Uchiyama and one can Google it as Solution of a Diophantine equation by sabur o ˆ Uchiyama \text{ Solution of a Diophantine equation by saburô Uchiyama}

So the solution for M , N M,N can be interred as ( 0 , 0 ) (0,0) , ( 1 , 1 ) (1,1) ( 10 , 5 ) (10,5) , ( 13 , 6 ) (13,6) , ( 645 , 85 ) (645,85)

C++

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
using namespace std;

int main()
{
    int m;
    double rn, rm;
    m = 1000;
    int i, n;
    for(i = 1; i<m; i++)
    {
        for(n = 1; n<i; n++)
        {
            rn = n*(n+1)*(2*n+1);
            rm = 3*i*(i+1);
            if(rn==rm)
            {
                cout << i << " " << n << "\n";
            }
        }
    }
}

Nick Turtle
Feb 5, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
for (let N = 0; N < 1000000; N++) {
    let SumOfSquares = N * (N + 1) * (2 * N + 1) / 6, // Sums the squares of all integers up to N
        M = (Math.sqrt(8 * SumOfSquares + 1) - 1) / 2; // Finds the triangular number equal to SumOfSquares
    if (Math.floor(M) === M) { // Checks if M is an integer
        console.log("M:", M, "N:", N); // Outputs M and N
    }
}
// Returns:
// M: 0, N: 0
// M: 1, N: 1
// M: 10, N: 5
// M: 13, N: 6
// M: 645, N: 85
// Answer is thus 645 + 85 = 730

Niraj Sawant
Sep 23, 2019

I don't know how to use Python in Brilliant Solution -

Here is the python code -

M = 0

N = 0

for i in range (1000):

     M += i

     N = 0

     for j in range (M+1):

            N += (j*j)

            if N == M:

                  print (N + M)

Output = 730 \boxed{730}

We get the next pair as - ( 645 , 85 ) ( 645 , 85 )

Atman Kar
Apr 6, 2018

Python brute force

Nicola Mignoni
Feb 20, 2018

MATLAB code:

I found it easier to use m m as the driver. The sum of consecutive integers is 1 2 n ( n + 1 ) \frac{1}{2} n (n+1) and the sum of squares of consecutive integers is 1 / 6 m ( 1 + m ) ( 1 + 2 m ) 1/6 m (1 + m) (1 + 2 m) . Solving for n n in terms of m m gives 1 2 ( 8 m 3 + 12 m 2 + 4 m + 3 3 1 ) \frac{1}{2} \left(\frac{\sqrt{8 m^3+12 m^2+4 m+3}}{\sqrt{3}}-1\right) . I then created a table of when that expression returned an integer: {{1,1},{10,5},{13,6},{645,85}}.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...