Three Cubes And A Square

The triplets of consecutive integers ( 0 , 1 , 2 ) (0,1,2) and ( 1 , 2 , 3 ) (1,2,3) have the property that the sum of their cubes is a perfect square:

0 3 + 1 3 + 2 3 = 3 2 , 1 3 + 2 3 + 3 3 = 6 2 . 0^3 + 1^3 + 2^3 = 3^2,\quad 1^3 + 2^3 + 3^3 = 6^2 .

Find the next smallest triplet of consecutive integers ( a , b , c ) (a, b, c) that has this property.

What is a + b + c ? a+b+c?


The answer is 72.

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.

8 solutions

Andrei Li
Aug 13, 2018

Set b = n b=n . We then see that a = n 1 a=n-1 , and c = n + 1 c=n+1 . Now, cube n 1 n-1 , n n , and n + 1 n+1 individually:

( n 1 ) 3 + n 3 + ( n + 1 ) 3 = n 3 3 n 2 + 3 n 1 + n 3 + n 3 + 3 n 2 + 3 n + 1 (n-1)^3+n^3+(n+1)^3=n^3-3n^2+3n-1+n^3+n^3+3n^2+3n+1

m 2 = 3 n 3 + 6 n m^2=3n^3+6n

Factorizing the above expression then yields

m 2 = 3 n ( n 2 + 2 ) m^2=3n(n^2+2)

This expression may not seem like an improvement. However, notice that 3 3 , n n , and n 2 + 2 n^2+2 are relatively prime: this implies that any solution must: 1 ) 1) have even exponents in all prime factors n > 3 n>3 in both n n and n 2 + 1 n^2+1 ; 2 ) 2) have an even exponent for n ( n 2 + 2 ) n(n^2+2) ; and 3 ) 3) have an odd exponent in 3 3 for n ( n 2 + 2 ) n(n^2+2) . 2 2 and 3 3 follow from the fact that the prime factorization of a perfect square must be of the form

m 2 = 2 2 a 1 3 2 a 2 . . . p i 2 a i m^2=2^{2a_1}3^{2a_2}...p_i^{2a_i}

where a 1 , a 2 . . . . a i a_1, a_2....a_i are integers n 0 n\geq0 , and 2 , 3... p i 2, 3...p_i are all of the prime factors of m m , trivial and non-trivial. (This results from multiplying m = 2 a 1 3 a 2 . . . p i a i m=2^{a_1}3^{a_2}...p_i^{a_i} by itself.) However, n n is multiplied by 3 3 and n 2 + 2 n^2+2 in the expression, so it follows that the exponent of 3 3 in n ( n 2 + 2 ) n(n^2+2) is odd, and that the power of 2 2 in n ( n 2 + n ) n(n^2+n) is even. The first two numbers to satisfy all three conditions are 2 2 and 24 24 . We have already seen n = 2 n=2 , and n = 24 n=24 yields

2 3 3 + 2 4 3 + 2 5 3 = 41616 = 20 4 2 23^3+24^3+25^3=41616=204^2

And of course, 23 + 24 + 25 = 72 23+24+25=72 .

Fine reasoning, but the constraints leave you with a lot of numbers to search. They boil down to: n n must be even and either a multiple of 3 or one less than a multiple of 3.

I'm not trying to be rude, I did a search to find the solution myself. I'm wondering if there's a way to find all solutions.

Jeremy Galvagni - 2 years, 10 months ago

Log in to reply

TLDR: the only solutions are [ 1 , 0 , 1 ] , [ 0 , 1 , 2 ] , [ 1 , 2 , 3 ] , [-1,0,1], [0,1,2], [1,2,3], and [ 23 , 24 , 25 ] [23,24,25] .

The equation 3 n 3 + 6 n = m 2 , 3n^3+6n = m^2, after the substitutions y = 3 m , x = 3 n , y=3m, x=3n, gives y 2 = x 3 + 18 x . y^2 = x^3+18x. This is an elliptic curve with torsion subgroup Z / 2 {\mathbb Z}/2 and rank 1 , 1, where the nontrivial 2-torsion point is P = ( 0 , 0 ) P = (0,0) and a generator of the free part is Q = ( 3 , 9 ) . Q = (3,9). Now P Q = ( 6 , 18 ) P-Q = (6,18) and P + 2 Q = ( 72 , 612 ) , P+2Q = (72,612), but all the other linear combinations do not give a point with integral coefficients (except for their negatives, which just correspond to flipping the sign of y y ). The heights of the denominators increase quite quickly, so it's pretty clear that there are no other solutions. Your favorite computer algebra system should be able to do a completely rigorous computation.

For instance, the computer algebra system MAGMA (which I used to compute the torsion subgroup and rank) has an IntegralPoints command that uses known bounds on the heights of integral points, and it verifies that the only integral points on y 2 = x 3 + 18 x y^2=x^3+18x are ( 0 , 0 ) , ( 3 , ± 9 ) , ( 6 , ± 18 ) , ( 72 , ± 612 ) . (0,0), (3, \pm 9), (6, \pm 18), (72, \pm 612).

Patrick Corn - 2 years, 10 months ago

No worries! Oh, and as for the solution, see below.

Andrei Li - 2 years, 10 months ago

I spent some time looking for an elegant solution but then I gave up and computed for 3 b 3 + 6 b ( 3 n ) 2 = 0 3b^{3} + 6b - (3n)^{2} = 0 ...

You should put a disclaimer for : " No elegant solutions in there !!" ahah.

Arousse Fares - 2 years, 10 months ago

Log in to reply

But that would ruin the element of surprise... ;)

Andrei Li - 2 years, 10 months ago

Log in to reply

True. And number theory is also about having a good intuition for numbers.

I'll keep it in mind. Thank you !

Arousse Fares - 2 years, 9 months ago

I made use of my mental arithmetic skills to calculate sums of the cubes of each set of three successive integers until I got one that worked (I wrote down a few of the numbers right near the end, but the work was all done in my head, and did not take very long).

Thomas Sutcliffe - 2 years, 9 months ago

How are 3 3 , n n , and n 2 + 2 n^2+2 relatively prime? What if n = 3 k n=3k ? Also n 2 + 2 n^2+2 is always divisble by 3 when n n isn't a multiple of 3.

MegaMoh . - 2 years ago
Kelvin Hong
Sep 2, 2018

My solution is base on solving Pell's Equation, a bit different compared to Andrei Li. (Note: All variables below are positive integers.)

Supposed the three consecutive integers are ( a 1 , a , a + 1 ) (a-1,a,a+1) , and the perfect square is n n , so 3 a ( a 2 + 2 ) = n 2 3a(a^2+2)=n^2

We see that n n must be multiple of 3 3 , hence let n = 3 m n=3m , we have a ( a 2 + 2 ) = 3 m 2 a(a^2+2)=3m^2

Now assume a a is multiple of 2 2 , then let a = 2 b a=2b , m = 2 k m=2k , thus b ( 2 b 2 + 1 ) = 3 k 2 b(2b^2+1)=3k^2

Now b b and 2 b 2 + 1 2b^2+1 is coprime, we can let { b = 3 c 2 2 b 2 + 1 = d 2 or { b = c 2 2 b 2 + 1 = 3 d 2 \begin{cases}b=3c^2\\2b^2+1=d^2\end{cases} \text{ or }\begin{cases}b=c^2\\2b^2+1=3d^2\end{cases}

We can find that b = 12 b=12 is the smallest in the first system and there is no smaller solution for b b in second system.

Now if a a is odd, then we may have { a = 3 c 2 a 2 + 2 = d 2 or { a = c 2 a 2 + 2 = 3 d 2 \begin{cases}a=3c^2\\a^2+2=d^2\end{cases}\text{ or }\begin{cases}a=c^2\\a^2+2=3d^2\end{cases}

We just have to check if there is any solution for a < 24 a<24 , in fact not.

Hence, a = 24 a=24 , then the answer is a 1 + a + a + 1 = 3 × 24 = 72 a-1+a+a+1=3\times24=\boxed{72} .

This is quite a tidy solution. I struggled to come up with a credible route by start with cubes of a, a+1, a+2. While the sum of the cubes factorises in a similar way, it's less apparent than starting with a-1, a, a+1 where the system resolves into coprime factors.

Nice work.

Malcolm Rich - 2 years, 9 months ago

Log in to reply

Thanks. Since we are not to find all solution, just the third smallest one, so no need to use a too rigorous method.

Kelvin Hong - 2 years, 9 months ago
Patrick Corn
Sep 4, 2018

Now that this is a Problem of the Week, I figured I'd repost my comment to Andrei's most-upvoted solution, since I see a lot of questions about finding all possible solutions.

TLDR: the only solutions are [ 1 , 0 , 1 ] , [ 0 , 1 , 2 ] , [ 1 , 2 , 3 ] , [-1,0,1], [0,1,2], [1,2,3], and [ 23 , 24 , 25 ] [23,24,25] .

The equation 3 n 3 + 6 n = m 2 , 3n^3+6n = m^2, after the substitutions y = 3 m , x = 3 n , y=3m, x=3n, gives y 2 = x 3 + 18 x . y^2 = x^3+18x. This is an elliptic curve with torsion subgroup Z / 2 {\mathbb Z}/2 and rank 1 , 1, where the nontrivial 2-torsion point is P = ( 0 , 0 ) P = (0,0) and a generator of the free part is Q = ( 3 , 9 ) . Q = (3,9). Now P Q = ( 6 , 18 ) P-Q = (6,18) and P + 2 Q = ( 72 , 612 ) , P+2Q = (72,612), but all the other linear combinations do not give a point with integral coefficients (except for their negatives, which just correspond to flipping the sign of y y ). The heights of the denominators increase quite quickly, so it's pretty clear that there are no other solutions. Your favorite computer algebra system should be able to do a completely rigorous computation.

For instance, the computer algebra system MAGMA (which I used to compute the torsion subgroup and rank) has an IntegralPoints command that uses known bounds on the heights of integral points, and it verifies that the only integral points on y 2 = x 3 + 18 x y^2=x^3+18x are ( 0 , 0 ) , ( 3 , ± 9 ) , ( 6 , ± 18 ) , ( 72 , ± 612 ) . (0,0), (3, \pm 9), (6, \pm 18), (72, \pm 612).

The sum of numbers (1, 2, ....n) squared is equal to the sum of each number cubed, or

  1. ( i = 0 a i ) 2 = i = 0 a i 3 (\sum_{i=0}^{a} i)^2 = \sum_{i=0}^{a} i^3

The left side of the equation will have numbers 1 2 , 3 2 , 6 2 , 1 0 2 1^2, 3^2, 6^2, 10^2 and so forth.

The right side will look like this; 1 3 + 2 3 + 3 2 + . . . . . + a 3 1^3 +2^3 +3^2 +.....+ a^3

That's one way to look at the first two triplets given in the problem. However, any number larger than 6 in using the sum will have more than 3 cubed numbers; for example, 1 0 2 = 1 3 + 2 3 + 3 3 + 4 3 10^2 = 1^3 +2 ^3 +3^3 + 4^3 . Thus, we must do something to limit the number of of cubed numbers to three. The way to do that is to subtract two squares that are 3 steps away from each other in the left side of the equation.

For example, 2 1 2 6 2 = ( ( 1 3 + 2 3 + 3 3 + 4 3 + 5 3 + 6 3 ) ( 1 3 + 2 3 + 3 3 ) = 4 3 + 5 3 + 6 3 21^2 - 6^2 = ((1^3 +2^3 +3^3 +4^3 +5^3 + 6^3) - (1^3 +2^3 +3^3) = 4^3 +5^3 + 6^3

The only problem now is that 2 1 2 6 2 21^2 - 6^2 itself does not equal a perfect square, so it does not satisfy the premise of the problem.

To account for this, we must look at Pythagorean Triples (a, b, c) where a and b are legs and c is the hypotenuse such that c and either a or b belong to the set of (numbers)^2 from the left side of equation 1.

For example, the Pythagorean triple (6, 8, 10) contains 6 and 10, which belong to the set of (outputs)^2 from the left side of Equation 1;

1 0 2 = 6 2 + 8 2 10^2 = 6^2 +8^2 which leads to 8 2 = 1 0 2 6 2 = ( 1 3 + 2 3 + 3 3 + 4 3 ) ( 1 3 + 2 3 + 3 3 ) = 4 3 8^2 = 10^2 - 6^2 = (1^3 +2^3 +3^3 +4^3) - (1^3 +2^3 +3^3) = 4^3

However, (3, 4, 5) would not work here because 5 does not belong to the set (1, 3, 6, 10....), thus we cannot express 5 directly as the sum of 1 3 + 2 3 . . . a 3 1^3 + 2^3...a^3 .

So the two conditions that we must satisfy are that the Pythagorean Triple must have c and (a or b) in the set of numbers (1, 3, 6, 10....) and that c and (a or b ) must be 3 numbers apart in that set.

With these two constraints, we can then search for a triple that works, and we find that the triple (204, 253, 325) satisfies both conditions and that it is the first triple since the ones provided in the problem.

Thus, 20 4 2 = 32 5 2 25 3 2 = ( 1 3 + 2 3 + . . . 2 5 2 ) ( 1 3 + 2 3 + . . . 2 2 2 ) = 2 3 3 + 2 4 3 + 2 5 3 204^2 = 325^2 - 253^2 = (1^3 + 2^3 + ... 25^2) - (1^3 + 2^3 + ... 22^2) = 23^3 + 24^3 + 25^3

2 3 3 + 2 4 3 + 2 5 3 = 20 4 2 23^3 + 24^3 + 25^3 = 204^2 and 23 + 24 + 25 = 72 23 + 24 + 25 = 72 _\square

This is my first time offering a solution, so please let me know how I can try and improve it, or if anything doesn't make sense. I also was not happy that I had to just sort of sift through Pythagorean triples until I found one that worked. If anyone has any ways to improve this method, please comment!

I like it! An elegant approach that totally constrains the solution nicely.

Spencer Hallyburton - 2 years, 9 months ago
Shivam Gupta
Sep 3, 2018

Well, I sort of cheated and ran a computer brute force simulation to find the answer. What is interesting to me is that there are only these 3 triplets till 10 Million and may be ahead.

Edit: It may take up to 10-50 Sec depending on the hardware of your PC.

The python3 code for same is:

1
2
3
4
5
for i in range(0,10000000):
    x=(i**3) + (i+1)**3 + (i+2)**3
    sq=int(x**0.5)
    if (sq*sq==x):
        print(i,i+1,i+2)

You could probably get 10 fold increase in speed by using numpy.

On a second thought, it is probably a bad idea to do that. Python 3 does not have maximum integer value, while numpy probably uses int64.

Darko Simonovic - 2 years, 9 months ago

Please don't destroy the spirit of problem solving

Ravi Utsav - 2 years, 9 months ago

Log in to reply

I wouldn't say this is ruining the problem. The up-voted solutions above are not greatly reducing the "search" space. To persuade your self, just ask the question, "what is the next triplet after (23,24,25)". This program will not give you the answer, but neither will above solutions. Truly complete answer is the one given by Patrick Corn, but it is buried in the replies. Unfortunately the solution is beyond my comprehension, but it lead me to open the page about elliptical curves and start learning something new. I believe that is the most you can get from discussing solutions, discover something new.

EDIT: Now Patrick Corn has reposted his comment as a solution.

Darko Simonovic - 2 years, 9 months ago

  1. This is in no way ruining the spirit of problem solving. When life gives us problem we are allowed to use all the tools allowed.
  2. Those who dont understand much of that complicated maths can use this tool to solve.
  3. What good is technological advancement if we cannot use it.
  4. The people who feel this is ruining spirit of problem solving should also consider never seeing solution to any question.

shivam gupta - 2 years, 9 months ago
Josh Gild
Sep 5, 2018

This is the code I wrote in Python 3 to solve this problem:

def f(x):
    return [pow(x, 3), pow(x+1, 3), pow(x+2, 3)];

for i in range(0, 100):
    if sum(f(i))**(1/2) % 2 == 0:
        print(str([i, i+1, i+2]) + ": " + str(sum(f(i))) + " = ( " + str((sum(f(i)))**(1/2)) + ")^2").

Using this code, the next smallest set of consecutive numbers are:

[23, 24, 25]: 41616: (204.0)^2

Therefore, 23 + 24 + 25 = 72

Arnaud Amiel
Sep 4, 2018

Found the same solution as everyone here but can't figure out how to show that there is not an other one.

I gave some indication of what might go into it in the comments to the top solution, via known bounds on integral points on (Weierstrass models of) elliptic curves.

Patrick Corn - 2 years, 9 months ago
Vinod Kumar
Sep 3, 2018

Check and verify,

23^3+24^3+25^3=(204)^2

Answer= (23+24+25)=72

improve more

improve more - 2 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...