Prime Numbers

Prime Numbers Prime Numbers

thales.doa.fmph.uniba.sk
from thales.doa.fmph.uniba.sk More from this publisher
10.12.2012 Views

5.6 Binary quadratic forms 241 so our restriction is not so severe. Another way of putting these restrictions is to say we are only considering forms (a, b, c) withb 2 − 4ac < 0anda>0. Note that these conditions then force c>0. We say that a form (a, b, c) of negative discriminant is reduced if −a 0. This algorithm constructs a reduced quadratic form equivalent to (A, B, C). 1. [Replacement loop] while(A >C or B>Aor B ≤−A) { if(A >C) (A, B, C) =(C, −B,A); // ‘Type (1)’ move. if(A ≤ C and (B >Aor B ≤−A)) { Find B ∗ ,C ∗ such that the three conditions: } } −A

242 Chapter 5 EXPONENTIAL FACTORING ALGORITHMS 5.6.2 Factoring with quadratic form representations An old factoring strategy going back to Fermat is to try to represent n in two intrinsically different ways by the quadratic form (1, 0, 1). That is, one tries to find two different ways to write n as a sum of two squares. For example, we have 65 = 8 2 +1 2 =7 2 +4 2 .Thenthegcdof(8· 4 − 1 · 7) and 65 is the proper factor 5. In general, if n = x 2 1 + y 2 1 = x 2 2 + y 2 2, x1 ≥ y1 ≥ 0, x2 ≥ y2 ≥ 0, x1 >x2, then 1 < gcd(x1y2−y1x2,n)

5.6 Binary quadratic forms 241<br />

so our restriction is not so severe. Another way of putting these restrictions<br />

is to say we are only considering forms (a, b, c) withb 2 − 4ac < 0anda>0.<br />

Note that these conditions then force c>0.<br />

We say that a form (a, b, c) of negative discriminant is reduced if<br />

−a 0.<br />

This algorithm constructs a reduced quadratic form equivalent to (A, B, C).<br />

1. [Replacement loop]<br />

while(A >C or B>Aor B ≤−A) {<br />

if(A >C) (A, B, C) =(C, −B,A); // ‘Type (1)’ move.<br />

if(A ≤ C and (B >Aor B ≤−A)) {<br />

Find B ∗ ,C ∗ such that the three conditions:<br />

}<br />

}<br />

−A

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!