A sequence is defined by , , and . How many perfect squares are in this sequence?
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.
Alternative 1
We claim that a n = b n 2 + ( − 1 ) n , where b n = 2 b n − 1 + b n − 2 , and b 0 = 0 and b 1 = 2 . Note that a n has the solution a n = 2 1 ( 3 − 2 2 ) n + 2 1 ( 3 + 2 2 ) n , and b n has the solution b n = 2 1 ( 1 + 2 ) n − 2 1 ( 1 − 2 ) n (both of which can be obtained by solving their respective characteristic equations). So we must prove that 2 1 ( 3 − 2 2 ) n + 2 1 ( 3 + 2 2 ) n = ( 2 1 ( 1 + 2 ) n − 2 1 ( 1 − 2 ) n ) 2 + ( − 1 ) n = 2 ( 3 + 2 2 ) n + ( 3 + 2 2 ) n − 2 ( 1 − 2 ) n ( 1 + 2 ) n + ( − 1 ) n = 2 1 ( 3 − 2 2 ) n + 2 1 ( 3 + 2 2 ) n , which is indeed true. So our claim is true, and hence a n = b n 2 + ( − 1 ) n , so a n is always 1 away from a perfect square. But the only two perfect squares that have a difference of 1 are 0 and 1 , and thus, due to the increasing nature of a n , we know that a 0 = 1 = 1 2 is the only perfect square in the sequence. Hence, the answer is 1 .
Alternative 2
Consider Pell's equation x 2 − 2 y 2 = 1 (where n = 2 ); it's fundamental solution is ( x 1 , y 1 ) = ( 3 , 2 ) , since this is the smallest solution where both x and y are positive integers. The complete set of solutions for x and y can then be described as x n y n = 3 x n − 1 + 4 y n − 1 = 2 x n − 1 + 3 y n − 1 (an elementary proof of this fact can be found here on the Brilliant wiki page). Combining these equations gives 4 1 ( x n + 1 − 3 x n ) ⟹ x n + 1 ⟹ x n = 2 x n − 1 + 4 3 ( x n − 3 x n − 1 ) = 6 x n − x n − 1 = 6 x n − 1 − x n − 2 , where x 1 = 3 and x 2 = 1 7 . But notice that a 1 = 3 and a 2 = 1 7 , and since their recurrence relations are the same, we have x n = a n ∀ n ≥ 1 .
Hence, letting x 2 = ( r 2 ) 2 = r 4 , r ∈ Z + , it suffices to find all positive, integral solutions for r in the equation r 4 − 2 y 2 = 1 (where y is also an integer, since the corresponding relation for y produces all integers by consequence). Notice this implies r is odd, and hence let r = 2 m + 1 , m ∈ Z + ∪ { 0 } . Factorising yields 2 y 2 ⟹ y 2 = 2 m ( 2 m + 2 ) ( 4 m 2 + 4 m + 2 ) = 4 m ( m + 1 ) ( 2 m 2 + 2 m + 1 ) . So m ( m + 1 ) ( 2 m 2 + 2 m + 1 ) = m ( m + 1 ) ( 2 m ( m + 1 ) + 1 ) must itself be a perfect square. But m , m + 1 , and 2 m ( m + 1 ) + 1 are pairwise coprime, so they must all be perfect squares themselves. The only two perfect squares that are 1 apart are 0 and 1 , implying that m = 0 , and hence r = 1 . So the only solution to the equation is ( r , y ) = ( 1 , 0 ) , which corresponds to x = a 0 = 1 2 as the only perfect square in the sequence. Hence, the answer is 1 .
Note: Alternative 1 is simpler, but does not show the inspiration behind the construction of a n .