The algorithm was presented by Selenius for ξ0=√D, but is valid if ξ0=(P0+√D)/Q0 is reduced or ξ0=(P0+√D)/Q0 is not reduced, but Q0>0.
Here ξ0=(u+t√d)/v, t non-zero, u,v,t,d integers, d > 1 and non-square.
We find the NSCF expansion until the end of the first RCF period is reached.
The output includes the positive and negative representations of the resulting NSCF complete quotients &xin
(See page 25, of the paper by A.A. Krisnaswami Ayyangar)
(Pn,Qn) = an + (P'n,Q'n)-1 = an + 1 - (P"n,Q"n)-1,
where (Pn,Qn) represents ξn = (Pn + √d)/Qn and an = ⌊&xin⌋.
Last modified 22nd April 2008
Return to main page