In 1914, Ramanujan 's friend P. C. Mahalanobis gave him a problem he had read in the English magazine Strand . The problem was to determine the number x of a particular house on a street where the houses were numbered 1 , 2 , 3 , … , n . The house with number x had the property that the sum of the house numbers to the left of it equaled the sum of the house numbers to the right of it. The problem specified that 5 0 < n < 5 0 0 .
Ramanujan quickly dictated a continued fraction for Mahalanobis to write down. The numerators and denominators of the convergents to that continued fraction gave all solutions ( n , x ) to the problem ( not just the particular one where 5 0 < n < 5 0 0 ) . Mahalanobis was astonished, and asked Ramanujan how he had found the solution.
Ramanujan responded, "...It was clear that the solution should obviously be a continued fraction; I then thought, which continued fraction? And the answer came to my mind."
This is not the most illuminating answer! If we cannot duplicate the genius of Ramanujan, let us at least find the solution to the original problem. What is x ?
Bonus:
Which continued fraction did Ramanujan give Mahalanobis?
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.
How do you prove that these are the "only" solutions for the Pell's Equation? I mean that how does one know that all solutions are of the form ( 1 + √ 2 ) n
Log in to reply
The simplest proof is to start by noting that the only number x = a + b 2 with a , b ∈ Z and 1 ≤ x < 1 + 2 and ∣ a 2 − 2 b 2 ∣ = 1 is x = 1 . This is done in various stages:
Next you need to know that if ( a + b 2 ) ( c + d 2 ) = e + f 2 , then ( a 2 − 2 b 2 ) ( c 2 − 2 d 2 ) = e 2 − 2 f 2 . Just check the algebra.
If x = a + b 2 is such that ( 1 + 2 ) ≤ x < ( 1 + 2 ) 2 and ∣ a 2 − 2 b 2 ∣ = 1 , then x ( 2 − 1 ) would be of the form c + d 2 with ∣ c 2 − 2 d 2 ∣ = 1 and 1 ≤ x ( 2 − 1 ) < 1 + 2 , and hence would be equal to 1 . Thus x = 1 + 2 .
Proceeding inductively, we can show that the only number of the form a + b 2 with ∣ a 2 − 2 b 2 ∣ = 1 and ( 1 + 2 ) n ≤ a + b 2 < ( 1 + 2 ) n + 1 is ( 1 + 2 ) n (for any positive integer n ). Thus the only numbers of the form a + b 2 with ∣ a 2 − 2 b 2 ∣ = 1 and a + b 2 ≥ 1 are the numbers ( 1 + 2 ) n for n ≥ 0 .The numbers of this type lying between 0 and 1 are the inverses of these, namely the numbers of the form ( 2 − 1 ) n for n ≥ 0 .
The more sophisticated method lies in understanding how the continued fraction expansion of 2 generates the solutions of Pell's equation. That would take too long to set out here! Check out a book on Elementary Number Theory, if you are interested.
Log in to reply
Thanks a lot.
This is nice. A fair amount of what you said above is also contained in the wiki on Pell's equation .
Same method
Log in to reply
I too did the same.Pells equation.Although recursions make it even easy to find solutions.For x 2 − 8 y 2 = 1 .we could build up the recursions y ( k + 1 ) = 3 y ( k ) + x ( k ) and x ( k + 1 ) = 3 x ( k ) + 8 y ( k )
Why can't it be of the form {a p^2, 2a q^2 } ?
Log in to reply
Because n and n + 1 have no common factor, and hence a must be 1 .
What about the bonus?
Log in to reply
The quotients q n p n are the convergents of the continued fraction expansion of 2 . See the final sentence of my solution - I have already answered the bonus part.
Log in to reply
Can you please elaborate 'convergents'?
Log in to reply
@Mr. India – Try here . A convergent of a continued fraction is what you get if you stop the infinite continued fraction after a finite number of steps. Thus the continued fraction expansion of 2 is 2 = 1 + 2 + 2 + 2 + 2 + ⋱ 1 1 1 1 The convergents are 1 = 1 , 1 + 2 1 = 2 3 , 1 + 2 + 2 1 1 = 5 7 , 1 + 2 + 2 + 2 1 1 1 = 1 2 1 7 and so on. If the n th convergent is q n p n , where p n , q n are coprime, then p n 2 − 2 q n 2 = ( − 1 ) n .
In the first line it should be {x(x+1)}/2
Log in to reply
No. I want the sum of numbers less than x , not less than or equal to x .
Ssame way as u did
I will focus on the "bonus" part of the question. Given condition --->
n^2 + n = 2x^2
Write it as ---> (2n+1)^2 - 8x^2 = 1.
Then express 8^0.5 as the continued fraction [2;1,4,1,4,1,4,1,4,...] . (Do it yourself)
So the solution is given by -
((2n+1)/x) = [2;1,4,1,4,1,4,1,4,...] (See the wiki on Pell's Equation)
P.S. - I don't know LaTeX
I did same analysis till the co-prime part of n, n+1. After that given the fact the solution for x = pq. I just enumerated primes till 17 since 50 < n < 500, 17^2 = 289 17^2 - 1 = 288 = 12^2 * 2 q=12 x=pq=204
Problem Loading...
Note Loading...
Set Loading...
The sum of the numbers less than x is 2 1 x ( x − 1 ) . The sum of the numbers greater than x is 2 1 n ( n + 1 ) − 2 1 x ( x + 1 ) . We want these sums to be equal, which means that we want 2 1 n ( n + 1 ) = x 2 . Since n and n + 1 are coprime, this means that the set { n , n + 1 } must be of the form { p 2 , 2 q 2 } for integers p , q . Thus p , q must be solutions of Pell's equation p 2 − 2 q 2 = ± 1 .
The positive integer solutions of Pell's equations are the integer pairs p n , q n , where p n + q n 2 = ( 1 + 2 ) n , n ∈ N . and the corresponding value of x will be p n q n . The only solution with 5 0 < x < 5 0 0 arises when n = 4 , so that p n = 1 7 , q n = 1 2 , and hence x = 2 0 4 and n = 2 8 8 .
Solutions to Pell's equation arise from convergents to the continued fraction expansion of 2 = [ 1 , 2 ] .