Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

General solution to Pell's Equation

0 views
Skip to first unread message

JSH

unread,
Feb 15, 2009, 10:52:45 AM2/15/09
to
General solution to Pell's Equation

Given

x^2 - Dy^2 = 1

I have proven:

y = [+/-2Dv/(f_1 - f_2*v^2 - 2v) +/- 1 -/+(f_1 + f_2*v^2)/(f_1 -
f_2*v^2 - 2v)]/(D-1)

and

x = +/-(f_1 + f_2*v^2)/(f_1 - f_2*v^2 - 2v) - [+/-2Dv/(f_1 - f_2*v^2 -
2v) +/- 1 -/+(f_1 + f_2*v^2)/(f_1 - f_2*v^2 - 2v)]/(D-1)

where f_1*f_2 = D-1, and the f's are non-zero integer factors, while v
is a free variable.

As Pell's Equation is normally considered in integers as a Diophantine
equation note that you find rational v such that x and y are integers,
which gives the 'why' of Pell's Equation. For instance, for D=2,
f_1*f_2 = 1, so I have:

y = [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 + v^2)/(1 - v^2 - 2v)]

and

x = +/-(1 + v^2)/(1 - v^2 - 2v) - [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 +
v^2)/(1 - v^2 - 2v)]

where I notice an easy case to give integer solutions with v = -2, as
I have then:

y = [-/+8/(1 - 4 + 4) +/- 1 -/+(1 + 4)/(1 - 4 + 4)] = [-/+8 +/- 1 -/+
5]

and

x = +/-(1 + 4)/(1 - 4 + 4) - [-/+8/(1 - 4 + 4) +/- 1 -/+(1 + 4)/(1 - 4
+ 4)] = +/-5 - [-/+8 +/- 1 -/+ 5]

So I get several solutions with that choice.

For instance, y = 8 - 1 + 5 = 12 is a solution, with x = 5 + 12 = 17,
as 17^2 - 2(12)^2 = 1.

Derivation of the result was done using research found by doors opened
by my Quadratic Diophantine Theorem, my use of it against Pell's
Equation, and my research result linking Pell's Equation to discrete
ellipses and Pythagorean Triples.

The value of basic research is shown by how somewhat disparate results
came together to answer a classical problem that is over 2000 years
old in an entirely new way, shattering beliefs I have come across
within the modern mathematical community that there are not new
answers to be found in seemingly well-worked areas.

Mathematics is an infinite subject. That is a good thing. Human
beings limit mathematics out of intellectual ignorance.

Discovery never ends unless people decide for ignorance over
knowledge.


James Harris

Enrico

unread,
Feb 15, 2009, 12:36:00 PM2/15/09
to

===================================================
Tested your formulas for the D's listed below.
XXX under V indicates no solutions found.
Asymptotic behavior noted for X, Y as V changes.

D f1 f2 V
2 1 1 -1,-2,-3
3 1 2 -1,-2
5 2 2 -2
6 1 5 -1
7 2 3 -1
8 1 7 -1
10 XXX
11 2 5 -1
12 XXX
13 XXX
14 XXX
15 2 7 -1


Enrico

JSH

unread,
Feb 15, 2009, 12:48:10 PM2/15/09
to

I don't understand that claim. Are you claiming no integer solutions
*could* be found or that your approach could not find integer
solutions? Or are you claiming no rational solutions as well?

Note that you can solve for v by taking a *known* solution to x^2 -
Dy^2 = 1, and using equations I have previously posted of which I know
you're aware as you have posted in those threads.

Further, isn't it just kind of wild that you can just solve for Pell's
Equation and get this explanation for why it behaves as it does.

Oh yeah, also note, in rationals the equations always work unless I
made a mistake in the derivation, which is the real point of my
interest here. Did I make a mistake in the equations themselves or
are they perfect?

x and y as given by a rational v should *always* give solutions in
rationals, or I made a derivation error.


James Harris

Enrico

unread,
Feb 15, 2009, 1:05:21 PM2/15/09
to
> James Harris- Hide quoted text -
>
> - Show quoted text -

===================================================
I yanked my previous post - didn't see the "rational v" (non-integer)
that you mentioned. Using integer v's, I found solutions for X and Y
except in the cases where I put XXX under the V column.

Rechecking D=10, f1=3, f2=3, v= -3/2 gives X=19, Y=6


Sorry about that
Enrico

JSH

unread,
Feb 15, 2009, 1:08:51 PM2/15/09
to

Thanks for the info!!! Not a problem. My only real concern was that
maybe the equations were mistaken.

Mathematics is about absolute perfection.

Without perfection you are not really doing math.

Now I feel like I can relax just a bit. Thanks again!!!


James Harris

Enrico

unread,
Feb 15, 2009, 2:53:01 PM2/15/09
to

====================================================
Tried the more difficult D = 13 case

D=13, f1=2, f2=6, v= -36/47 gives X= 649, Y= -180

649^2 - 13*180^2 = 1

Looks like your formulas work for rationals


Enrico

JSH

unread,
Feb 15, 2009, 3:18:41 PM2/15/09
to

Great!!! Thanks Enrico!

That's what I love about mathematics: perfection is attainable.

And I love perfect.


James Harris

Tim Smith

unread,
Feb 16, 2009, 5:15:12 AM2/16/09
to
In article
<929a5105-b532-4233...@x6g2000pre.googlegroups.com>,
JSH <jst...@gmail.com> wrote:

> General solution to Pell's Equation
>
> Given
>
> x^2 - Dy^2 = 1
>
> I have proven:
>
> y = [+/-2Dv/(f_1 - f_2*v^2 - 2v) +/- 1 -/+(f_1 + f_2*v^2)/(f_1 -
> f_2*v^2 - 2v)]/(D-1)
>
> and
>
> x = +/-(f_1 + f_2*v^2)/(f_1 - f_2*v^2 - 2v) - [+/-2Dv/(f_1 - f_2*v^2 -
> 2v) +/- 1 -/+(f_1 + f_2*v^2)/(f_1 - f_2*v^2 - 2v)]/(D-1)
>
> where f_1*f_2 = D-1, and the f's are non-zero integer factors, while v
> is a free variable.

Let's check this with Mathematica, and also simplify it.

I'll just do the the case where we take the + side of +/- and the - side
of -/+ uniformly.

Let's define y as a function of v:

Y[v_] = (2 (f1 f2 + 1) v/(f1 - f2 v^2 - 2 v) +
1 - (f1 + f2 v^2)/(f1 - f2 v^2 - 2 v))/(f1 f2)

and similarly for x:

X[v_] = (f1 + f2 v^2)/(f1 - f2 v^2 -
2 v) - (2 (f2 f1 + 1) v/(f1 - f2 v^2 - 2 v) +
1 - (f1 + f2 v^2)/(f1 - f2 v^2 - 2 v))/(f1 f2)

Note that I've replaced D with (f1 f2 + 1).

Now let's check to see if this satisfies the Pell equation. I enter
into Mathematica:

X[a]^2 - (f1 f2 + 1) Y[a]^2

and it spits out this monstrosity:

-(((1 + f1 f2) (1 - (f1 + a^2 f2)/(-2 a + f1 - a^2 f2) + (
2 a (1 + f1 f2))/(-2 a + f1 - a^2 f2))^2)/(
f1^2 f2^2)) + ((f1 + a^2 f2)/(-2 a + f1 - a^2 f2) - (
1 - (f1 + a^2 f2)/(-2 a + f1 - a^2 f2) + (
2 a (1 + f1 f2))/(-2 a + f1 - a^2 f2))/(f1 f2))^2

However, asking it to simplify that, it gives:

1

So congratulations--your x and y do satisfy x^2-d y^2 = 1 for all real
values of the parameter v for which both x and y are defined.

Asking Mathematica to simplify x and y gives this:

f1^2 + 2 v^2 + f1 v (-2 + f2 v)
x = -------------------------------
f1 (f1 - v (2 + f2 v))


2 (f1 - v) v
y = ----------------------
f1 (f1 - v (2 + f2 v))


>
> As Pell's Equation is normally considered in integers as a Diophantine
> equation note that you find rational v such that x and y are integers,
> which gives the 'why' of Pell's Equation. For instance, for D=2,
> f_1*f_2 = 1, so I have:
>
> y = [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 + v^2)/(1 - v^2 - 2v)]
>
> and
>
> x = +/-(1 + v^2)/(1 - v^2 - 2v) - [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 +
> v^2)/(1 - v^2 - 2v)]

Simplified (again, just the + case for +/-, - case for -/+, leaving the
other case for others to do):

-1 + 2v - 3 v^2
x = ---------------
-1 + 2v + v^2


2 v (v - 1)
y = ---------------
-1 + 2v + v^2

These blow up at -1-sqrt(2) and -1+sqrt(2), and are well behaved away
from those. From -oo to -3, it doesn't look like there are any
solutions. Similar from 2 to oo. Around the blow up points, x and y
each take on an infinite number of integers. The functions are
continuous, so we can even conclude that every integer solution will be
found among these.

Finally, there are some values away from the blow up where they take on
integers, such as v = -2, which you found.

BTW, James, you probably can drop the whole +/- and -/+ stuff. Consider
the solution x=17, y=12 of x^2-2 y^2=1. There are four values of v that
give essentially that solution using the functions above for x and y.

v = { -3, -2, 2/5, 3/7 }

These give (-17, 12),
( 17, -12),
( 17, 12),
(-17, -12).

I believe that your original equations, with the +/- and -/+ flipped,
will just give similar variations.

What's missing here, and what disqualifies this from being a general
solution (or even a solution), is that you have not given a way to find
the v's that work.

Of course, one could use standard methods for solving the Diophantine
equation, and go backwards!

The convergents of the continued fraction for sqrt(2) are:

1, 3/2, 7/5, 17/12, 41/29, 99/70, 239/169, 577/408

Every other one of these, starting with the second, corresponds to a
solution, with x being the numerator and y the denominator.

For x=3, y=2, we have v = 1/3.

For x=17, y=12, we have v = 2/5.

For x=99, y=70, we have v = 7/17.

For x=577, y=408, we have v = 12/29.

But this is unsatisfactory, of course, as it requires us to already have
a solution in order to solve the equation!

I don't see any particular pattern in these v values to allow them to be
found some other way.

--
--Tim Smith

JSH

unread,
Feb 16, 2009, 10:35:57 AM2/16/09
to
On Feb 16, 2:15 am, Tim Smith <reply_in_gr...@mouse-potato.com> wrote:
> In article
> <929a5105-b532-4233-b042-7de47e94f...@x6g2000pre.googlegroups.com>,

Interesting.

>
> > As Pell's Equation is normally considered in integers as a Diophantine
> > equation note that you find rational v such that x and y are integers,
> > which gives the 'why' of Pell's Equation. For instance, for D=2,
> > f_1*f_2 = 1, so I have:
>
> > y = [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 + v^2)/(1 - v^2 - 2v)]
>
> > and
>
> > x = +/-(1 + v^2)/(1 - v^2 - 2v) - [+/-4v/(1 - v^2 - 2v) +/- 1 -/+(1 +
> > v^2)/(1 - v^2 - 2v)]
>
> Simplified (again, just the + case for +/-, - case for -/+, leaving the
> other case for others to do):
>
>        -1 + 2v - 3 v^2
>    x = ---------------
>         -1 + 2v + v^2
>
>          2 v (v - 1)
>    y = ---------------
>         -1 + 2v + v^2
>
> These blow up at -1-sqrt(2) and -1+sqrt(2), and are well behaved away

Field is rationals and v is rational, so those values are not
available.

> from those.  From -oo to -3, it doesn't look like there are any
> solutions.  Similar from 2 to oo.  Around the blow up points, x and y
> each take on an infinite number of integers.  The functions are
> continuous, so we can even conclude that every integer solution will be
> found among these.
>
> Finally, there are some values away from the blow up where they take on
> integers, such as v = -2, which you found.
>
> BTW, James, you probably can drop the whole +/- and -/+ stuff.  Consider
> the solution x=17, y=12 of x^2-2 y^2=1.  There are four values of v that
> give essentially that solution using the functions above for x and y.
>
> v = { -3, -2, 2/5, 3/7 }
>
> These give (-17,  12),
>            ( 17, -12),
>            ( 17,  12),
>            (-17, -12).
>
> I believe that your original equations, with the +/- and -/+ flipped,
> will just give similar variations.
>
> What's missing here, and what disqualifies this from being a general
> solution (or even a solution), is that you have not given a way to find
> the v's that work.

Nope. It's fairly trivial to get a continued fraction from the
equations you showed so it is weird you'd make that statement. A
better way though is to let v = b/a where 'b' and 'a' are integers and
establish congruence relationships.

My take on your post is you used math software to simplify things, and
then unfortunately relied on your personal mathematical knowledge--
stick to the software--to make a false leap betraying a woeful lack of
knowledge in this area, or you lied and just wanted an excuse to yet
again to dismiss my research.

One more thing you can do with Mathematica: with D a composite sum
the numerator and denominator of x and find the minima, and then
subtract one from the other and find it again.

Check to see if you factored D non-trivially. Report back.

You see, those equations turn the factoring problem into a calculus
problem. Are you going to make a false statement about that too?


James Harris

Tim Smith

unread,
Feb 16, 2009, 2:50:43 PM2/16/09
to
In article
<7a02b1fa-bc88-4dfe...@x6g2000pre.googlegroups.com>,

JSH <jst...@gmail.com> wrote:
> > Simplified (again, just the + case for +/-, - case for -/+, leaving the
> > other case for others to do):
> >
> >        -1 + 2v - 3 v^2
> >    x = ---------------
> >         -1 + 2v + v^2
> >
> >          2 v (v - 1)
> >    y = ---------------
> >         -1 + 2v + v^2
> >
> > These blow up at -1-sqrt(2) and -1+sqrt(2), and are well behaved away
>
> Field is rationals and v is rational, so those values are not
> available.

There are rational numbers arbitrarily close to both -1-sqrt(2) and
-1+sqrt(2), James. The expressions for both x and y blow up as you
approach -1-sqrt(2) and -1+sqrt(2) through the rationals.

Your expressions for x and y work for real v, too, James, and are
continuous functions when viewed as real functions. As v goes to oo or
-oo, they both approach finite limits. If they did not blow up
somewhere, then their range would be finite, and their values at
rational v could not include all of the integer solutions to the
original Diophantine equation.

In other words, you are supposed to be happy they blow up, as that is a
necessary condition for a solution of the form you gave to work.

...


> > What's missing here, and what disqualifies this from being a general
> > solution (or even a solution), is that you have not given a way to find
> > the v's that work.
>
> Nope. It's fairly trivial to get a continued fraction from the
> equations you showed so it is weird you'd make that statement. A
> better way though is to let v = b/a where 'b' and 'a' are integers and
> establish congruence relationships.

Then do it. You've found a curve in 2D, which you've described
parametrically, such that among its rational points are all the
integer solutions of the Pell equation for a given D.

I don't know about that particular curve, but there certainly are
some curves for which their rational points are of tremendous
importance. E.g., rational points on elliptic curves have great
importance in cryptography. Maybe your curve will be as important--or
maybe you've done nothing but transform the problem into an equivalent
problem that is just as hard to solve (like some of your factoring
solutions) and so it will have no importance at all. Why not find out?

So instead of descending into your usual obnoxious paranoia, why
not for once actually finish writing up your discovery, without
leaving out things, like how to choose v. No "it's fairly trivial" hand
waving.

--
--Tim Smith

Mensanator

unread,
Feb 16, 2009, 3:43:08 PM2/16/09
to
On Feb 15, 9:52 am, JSH <jst...@gmail.com> wrote:
> General solution to Pell's Equation

Hey Jimmy, did you see the thread about Pells' equation
and the Collatz Conjecture over in sci.math?

JSH

unread,
Feb 17, 2009, 8:26:11 PM2/17/09
to
On Feb 16, 11:50 am, Tim Smith <reply_in_gr...@mouse-potato.com>
wrote:
> In article
> <7a02b1fa-bc88-4dfe-ade2-eb5c4e3dc...@x6g2000pre.googlegroups.com>,

>
>
>
>  JSH <jst...@gmail.com> wrote:
> > > Simplified (again, just the + case for +/-, - case for -/+, leaving the
> > > other case for others to do):
>
> > >        -1 + 2v - 3 v^2
> > >    x = ---------------
> > >         -1 + 2v + v^2
>
> > >          2 v (v - 1)
> > >    y = ---------------
> > >         -1 + 2v + v^2
>
> > > These blow up at -1-sqrt(2) and -1+sqrt(2), and are well behaved away
>
> > Field is rationals and v is rational, so those values are not
> > available.
>
> There are rational numbers arbitrarily close to both -1-sqrt(2) and
> -1+sqrt(2), James.  The expressions for both x and y blow up as you
> approach -1-sqrt(2) and -1+sqrt(2) through the rationals.
>
> Your expressions for x and y work for real v, too, James, and are
> continuous functions when viewed as real functions.  As v goes to oo or
> -oo, they both approach finite limits.  If they did not blow up
> somewhere, then their range would be finite, and their values at
> rational v could not include all of the integer solutions to the
> original Diophantine equation.
>
> In other words, you are supposed to be happy they blow up, as that is a
> necessary condition for a solution of the form you gave to work.

I worry first about correctness, and for that focus is on the
rationals, but I will admit not being upset that you say things work
well elsewhere. I simply find I can't force myself to focus in that
area at this time.

> ...
>
> > > What's missing here, and what disqualifies this from being a general
> > > solution (or even a solution), is that you have not given a way to find
> > > the v's that work.
>
> > Nope.  It's fairly trivial to get a continued fraction from the
> > equations you showed so it is weird you'd make that statement.  A
> > better way though is to let v = b/a where 'b' and 'a' are integers and
> > establish congruence relationships.
>
> Then do it.  You've found a curve in 2D, which you've described
> parametrically, such that among its rational points are all the
> integer solutions of the Pell equation for a given D.
>
> I don't know about that particular curve, but there certainly are
> some curves for which their rational points are of tremendous
> importance.  E.g., rational points on elliptic curves have great
> importance in cryptography.  Maybe your curve will be as important--or
> maybe you've done nothing but transform the problem into an equivalent
> problem that is just as hard to solve (like some of your factoring
> solutions) and so it will have no importance at all.  Why not find out?

Because I'm still freaked out. Maybe in a month or two...

> So instead of descending into your usual obnoxious paranoia, why
> not for once actually finish writing up your discovery, without
> leaving out things, like how to choose v.  No "it's fairly trivial" hand
> waving.

Substitute out v into integers like v = b/a, as it's a rational, which
gives you another degree of freedom and then you should be able to
easily find conditions to solve for integer x and y.

I would do it myself now, but I'm still freaked out (see above).
Should be easy though.

In the meantime I'll just kind of try to veg out until my nerves stop
jangling. As it's been a week already I suspect it may take a while,
like a few months, then I can work it all out some more. Mostly I
kind of just wander around now, and wait for my nerves to settle
down. Not really doing much else besides drinking.


James Harris

Lits O'Hate

unread,
Feb 18, 2009, 4:30:25 PM2/18/09
to

Good idea, James. Stick with what works.

--
"But in the meantime, at least we can have fun. I
personally will drink some more, as, at least I have
that. Thank God for alcohol." -- James Harris

0 new messages