FInd the sum of all positive integers n < 2 0 1 7 that have the property that n 2 + ( n + 1 ) 2 is also 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.
Very nice. I used the fact that if ( x , y ) = ( a , b ) is the smallest solution of x 2 − 2 y 2 = 1 , then ( m , n ) such that m + n 2 = ( a + b ) k , for some positive integer k , produces all of the solutions to the equation. I didn't know there was a recursive way to find solutions! Alas, I've learned something new :) In hindsight, I realize that since there is a formula for finding all solutions to a Pell equation given that you know its fundamental solution, it makes sense for there to be a recursive approach.
Log in to reply
@Zach Abueg can you please write and explain your solution too
got the solution via the pell equation but in a different way,
n 2 + ( n + 1 ) 2 2 n 2 + 2 n + 1 2 1 × ( ( 2 n + 1 ) 2 + 1 ) ( 2 n + 1 ) 2 − 2 ( 2 x + 1 ) 2 = ( 2 x + 1 ) 2 n 2 + ( n + 1 ) 2 is odd = ( 2 x + 1 ) 2 = ( 2 x + 1 ) 2 = − 1
setting u = ( 2 n + 1 ) and v = ( 2 x + 1 ) we get,
u 2 − 2 v 2 = − 1
now we look for solutions where u and v are both odd and u < 4 0 3 5
@Sharky Kesa , I think you meant to write ( 9 9 , 7 0 ) in Part 1. This would correspond to ( p , q ) = ( 1 6 9 , 7 0 ) , and n = 2 3 6 6 0 , not 7 2 5 2 .
We want n 2 + ( n + 1 ) 2 = m 2 , so that ( 2 n + 1 ) 2 + 1 = 2 m 2 , and hence ( 2 n + 1 ) 2 − 2 m 2 = − 1 The positive integer solutions of the equation x 2 − 2 y 2 = − 1 are well-known to be given by the formula x k + y k 2 = ( 1 + 2 ) 2 k + 1 k ≥ 0 (the even powers of 1 + 2 give the positive integer solutions of x 2 − 2 y 2 = 1 ). The first 6 pairs ( x k , y k ) are ( 1 , 1 ) , ( 7 , 5 ) , ( 4 1 , 2 9 ) , ( 2 3 9 , 1 6 9 ) , ( 1 3 9 3 , 9 8 5 ) and ( 8 1 1 9 , 5 7 4 1 ) , giving values of 0 , 3 , 2 0 , 1 1 9 , 6 9 6 , 4 0 5 9 for n .
Larger values of k yield larger values of n . Thus the answer is 3 + 2 0 + 1 1 9 + 6 9 6 = 8 3 8
This is considered as cheating.
Computational approach incoming, now with easy excel that doesn't even need any coding basics.
Write this in excel.
This is how it works.
Column B would be straightforward to understand, and so is column C;
Now floor it down by column D.
If the result of B is a square, then C is a natural number, then C=D. If the result of B wasn't, then C is not a natural number, then C>D.
Column E tries to calculate the square root of D-C, however, this will return an error: "#NUM!" if C>D.
Therefore, only two values can fill the column E, which are "0"s and "#NUM"s.
Get some filter on top of column E, and you're ready to go.
Now extend the list as 1 ≤ n ≤ 2 0 1 7 .
(Click and drag the bottomright corner of A2 downwards till A2018. Select B2~E2, and click and drag the bottomright corner of E2 downwards till B2018~E2018.)
And then, click on the filter and deselect "#NUM".
It seems like the answer is 3 + 2 0 + 1 1 9 + 6 9 6 = 8 3 8 .
Furthermore, typing this sequence up in Wolframalpha,
OEIS A001652 is the sequence where a n 2 + ( a n + 1 ) 2 is a square.
The terms are found by a recurrence formula which follows a n + 2 = 6 a n + 1 − a n + 2 , a 0 = 0 , a 1 = 3 .
Again, this is cheating, considering this problem is a Number Theory problem.
I do it with C program.
First I keep the perfect squares in an array. Then I input n 's value and check that for which n ans matches with the perfect square which I kept in an array before. After that I added all n for answer.
( n ) 2 + ( n + 1 ) 2 = ( n + x ) 2 So on expanding we get n 2 − 2 n ( x − 1 ) − ( x 2 − 1 ) = 0 . So by quadratic equation formula we get n = 2 2 ( x − 1 ) + ( 2 ( x − 1 ) ) 2 + 4 ( x 2 − 1 ) . For x need to be an integer we need ( 2 ( x − 1 ) ) 2 + 4 ( x 2 − 1 ) to be perfect square. So by expanding we get ( 2 ( x − 1 ) ) 2 + 4 ( x 2 − 1 ) = 8 x ( x − 1 ) . we can check for perfect square in 2 x ( x − 1 ) . x and 2 ( x − 1 ) needs to be perfect squares or 2 x and ( x − 1 ) needs to be perfect squares. We can check each of the squares doubles. Thus we get 2,8,18,32,50,72,98,128,162,200,242,288,338,392,450,512,578,648,722,800,882,968,1058 etc for first few squares. we get some squares from its +1 or -1 then we get a value. 2-1=1,8+1=9,50-1=49, 288+1=289 are the squares we get from these. substituting these values in the quadratic equation we get n as 3 , 2 0 , 1 1 9 , 6 9 6 . Thus the final answer is 6 9 6 + 1 1 9 + 2 0 + 3 = 8 3 8
We use Latex, not Tex. Just replace $$...$$ with \ ...\ and $...$ with \ ...\ .
My solution wasn't as good as the others. I just used the PPT formulas to set up the two quadratic equations. The discriminant of each of those equations was 2 p 2 + 1 . So I checked all the values of p from 1 to 40 (by hand too) to see which produced a perfect square. There were only two: 2 and 1 2 . There turned out to be two values of n corresponding to each for a total of four values: 3 , 2 0 , 1 2 0 , 6 9 6 .
Problem Loading...
Note Loading...
Set Loading...
Note that these squares form a primitive Pythagorean Triplet, so there exist integers p and q such that n = p 2 − q 2 and n + 1 = 2 p q (or the other way around). Thus, p 2 − q 2 = 2 p q ± 1 ⟹ ( p − q ) 2 + 2 q 2 = ± 1 .
Let u = p − q , and v = q , so we have the Pell equations u 2 − 2 v 2 = 1 and u 2 − 2 v 2 = − 1 .
Part 1: u 2 − 2 v 2 = 1
The fundamental solution of this can be observed as being ( 3 , 2 ) . Thus, using the recursive formula ( u n + 1 , v n + 1 ) = ( u 0 u n + D v 0 v n , u 0 v n + v 0 u n ) , we get the following solutions: ( 3 , 2 ) , ( 1 7 , 1 2 ) , ( 9 9 , 7 0 ) , … . These give the respective values for ( p , q ) : ( 5 , 2 ) , ( 2 9 , 1 2 ) , ( 1 4 8 , 7 0 ) , … , which respectively give these values for n : n = 2 0 , 6 9 6 , 2 3 6 6 0 , … . Thus, all satisfying n < 2 0 1 7 in this case are n = 2 0 , 6 9 6 .
Part 2: u 2 − 2 v 2 = − 1
The fundamental solution for this can be observed as being ( 1 , 1 ) . Thus, using the recursive formula ( u n + 1 , v n + 1 ) = ( u 0 ′ u n + D v 0 ′ v n , u 0 ′ v n + v 0 ′ u n ) , where ( u 0 ′ , v 0 ′ ) is the fundamental solution of u 2 − 2 v 2 = 1 , we get the following solutions: ( 1 , 1 ) , ( 7 , 5 ) , ( 4 1 , 2 9 ) , … . These give the respective values for ( p , q ) : ( 2 , 1 ) , ( 1 2 , 5 ) , ( 7 0 , 2 9 ) , … , which respectively give these values for n : n = 3 , 1 1 9 , 4 0 5 9 , … . Thus, all satisfying n < 2 0 1 7 in this case are n = 3 , 1 1 9 .
Thus, we have all satisfying values of n to be 3 , 2 0 , 1 1 9 , 6 9 6 , so their sum is 8 3 8 .
Note that another solution exists, using Vieta Root Jumping on ( p , q ) .