--- In

primenumbers@yahoogroups.com,

"bhelmes_1" <bhelmes@...> asked:

> d=4n+2 or d=4n+3

> and the equation of Pell a^2-d*b^2=1

> What is the fastest way to solve the equation of Pell

In the case of positive d = 3 mod 4,

used quadunit(4*d), in Pari-GP,

and then take powers of this unit,

which has norm = +1.

Here is an example with d = 139:

{d=139;q=quadunit(4*d);r=1;

for(n=1,100,r*=q;print([n,a=real(r),b=imag(r)]))}

[1, 77563250, 6578829]

[2, 12032115501124999, 1020550716868500]

[3, 1866499965285267079810250, 158314460780301358671171]

...

NB: At n=100, "a" has 819 decimal digits.

David