Suppose I had $n = a + \sqrt{b}$ as a decimal of arbitrary precision, but didn't know $a$ or $b$, except that they are positive integers.
If I had just $\sqrt{b}$, I could just square it and end up with something very close to an integer, so I'd have $b$.
If I take $n^2 - 2an$, I get $(a^2 + b + 2a\sqrt{b}) - (2a^2 + 2a\sqrt{b}) = b - a^2$ which will be an integer, but I don't have $a$...
Is there some way to take the sum of the integral and decimal portion of $n$ and do some integer voodoo there?
Thanks for any ideas.
No comments:
Post a Comment