whatta
- 256
- 0
btw, on Pell equation. I wrote a brute force script (copy paste in html file),
(edit:ah, I've found the flaw in my script (fixed above), now it actually finds something)
Code:
<script>
// find solutions for x^2=ny^2 + 1 in integers for n > 0 by brute force
// this takes lots of time, so be patient and do not abuse task manager
limit = 1234567; // this is when do we stop wasting CPU cycles
for (n = 1; n < 10; n++) {
x = 1;
y = 1;
i = 0;
while (i++ < limit) {
l = x * x;
r = n * y * y + 1;
if (l==r) {
alert ("Solution: n="+n+", x="+x+", y="+y);
break;
}
if (l > r) y++;
if (l < r) x++;
}
if (x * x != n * y * y + 1)
alert ("No solution was found for n="+n+" up to x="+x+", y="+y);
}
alert ("Nothing to wait for :(");
</script>
(edit:ah, I've found the flaw in my script (fixed above), now it actually finds something)
Last edited: