1
$\begingroup$

A Pell's equation is given in the following way:

$ nx^2 + 1 = y^2 $

According to mathematical rules and the website http://www-groups.dcs.st-and.ac.uk/~history/HistTopics/Pell.html it can also be written like this:

$y^2 - nx^2 = 1$

The equation Bhaskara II uses as an example is:

$y^2 - 61x^2 = 1$

So you have to find x and y. A solution I found was $x = 226153980, y = 1766319049$. I tested the correctness of the result with the first version of the Pell's equation (see above):

$ 61x^2 + 1 = y^2 $

$ 61 * 226153980 + 1 = 1766319049^2 \Rightarrow y = 1766319049 $

So the result is correct. Now let's try it with the second way of writing it:

$ y^2 - 61x^2 = 1 $

$ 1766319049^2 - 61 * 226153980^2 = 0 \neq 1 $ (According to Google)

So the first equation proves the correctness and the second one? What's wrong with my logic or approach that the obviously correct solution equals 0?

  • 0
    Wolfram gives the right result . http://www.wolframalpha.com/input/?i=1766319049%5E2-61%28226153980%5E2%292011-12-12

3 Answers 3

1

I did not notice this one at the time. Start with $ 29718^2 - 61 \cdot 3805^2 = -1.$ Then use this version of BRAHMAGUPTA'S IDENTITY that is easily verified by hand, $ \left( a^2 - 61 b^2 \right)^2 = \left( a^2 + 61 b^2 \right)^2 - 61 \left( 2 a b\right)^2, $ using $ a = 29718, \; \; b = 3805.$ We find $ a^2 + 61 b^2 = 1,766,319,049 $ and $ 2 a b = 226,153,980. $ So $ 1766319049^2 - 61 \cdot 226153980^2 = \left( -1 \right)^2 = 1 $ after erasing the commas.

10

It should be easy to see that Google is wrong in this instance by looking at the last digit of what your answer should be. The first number ends in 9 which, when squared, will end in 1. And you're subtracting a multiple of 10. So just by simple inspection, the answer should have a last digit of 1.

6

Well, it seems Google is wrong, for if I paste the same line in my haskell interpreter, I get 1. Although I'm surprised about it, it probably means google does some rounding when numbers get too large.

  • 0
    Yes, I tested it some minutes later with pow. That worked. I know that "^" exists in other languages. But whatever. Thank you. :)2011-12-12