Let
be consecutive non-negative integers, and
also let
be consecutive non-negative integers.
Find the number distinct values of in the interval .
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.
Relevant wiki: Pell's Equation
Let A , B , C take the values of a , a + 1 , a + 2 , respectively, and
let P , Q , R , S take the values of b , b + 1 , b + 2 , b + 3 , respectively,
where a and b are non-negative integers.
Substituting these values into the equation A 2 + B 2 + C 2 = P 2 + Q 2 + R 2 + S 2 and simplifying gives
3 a 2 + 6 a = 4 b 2 + 1 2 b + 9 ⇔ 3 ( a + 1 ) 2 − 3 = ( 2 b + 3 ) 2 .
Since LHS is divisible by 3, then so is RHS, so 3 ∣ ( 2 b + 3 ) ⇒ 3 ∣ b . Let b = 3 c , where c is also a non-negative integer,
3 ( a + 1 ) 2 − 3 = ( 6 b + 3 ) 2 ⇔ ( a + 1 ) 2 − 1 = 3 ( 2 c + 3 ) 2 ⇔ Y 2 − 3 Z 2 = 1 ,
where Y = a + 1 , Z = 2 c + 3 . This final equation represents a Pell's equation .
A fundamental solution to this equation is ( Y 1 , Z 1 ) = ( 2 , 1 ) . And the family of solutions to this diophantine equation satisfies
{ Y k = Y k − 1 Y 1 + n Z k − 1 Z 1 Z k = Y K − 1 Z 1 + Z K − 1 Y 1 .
With this recurrence relation, we can obtain ( Y , Z ) = ( 2 , 1 ) , ( 7 , 4 ) , ( 2 6 , 1 5 ) , ( 9 7 , 5 6 ) , ( 3 6 2 , 2 0 9 ) , ( 1 3 5 1 , 7 8 0 ) , ( 5 0 4 2 , 2 9 1 1 ) , … .
Knowing that Y = a + 1 , Z = 2 c + 3 , and nothing that c is a non-negative integer, then some of the solutions above are not fulfilled. We are left with
( a , c ) = ( 1 , 0 ) , ( 2 5 , 6 3 ) , ( 3 6 1 , 9 3 6 ) , ( 5 0 4 1 , 1 3 0 9 5 ) , … ⇒ ( a , b ) = ( 1 , 0 ) , ( 2 5 , 2 1 ) , ( 3 6 1 , 3 1 2 ) , ( 5 0 4 1 , 4 3 6 5 ) , … .
Trial and error shows that only the first 3 solutions satisfy the constraint that 0 < X = A 2 + B 2 + C 2 = P 2 + Q 2 + R 2 + S 2 < 1 0 6 .