New Algorithm Involving Quadratic Residues (Part IVd)

xs from Even p

An integer r is called a quadratic residue modulo p if it is congruent to a perfect square modulo p:

x2r (mod p)

with the number of residues for a given prime given by the equation (p − 1)/2 where the one value x2 = 0 is removed before division by 2.

Algorithm and x Values

This section is a continuation of Part IVc with r = 393 and using an even number p = 1564 where p may be factored as either 2(782) or 4(391). If p1 = 782 then x = 3172 = 393 + 728(128) and if p2 = 391 then x2 = 3172 = 393 + 391(257) the only difference being in the quotients. It will be shown that the results instead of returning four x terms will return eight where the latter four x terms sum to 3×p = 4692 as opposed to the former p = 1564. In addition, since the factors for 931 are 17 and 21, it will be shown below that 393(mod 391) ≡ 2(mod 391) and will exhibit additional x values along with those found for 393(mod 1564).

Thus the values to be distributed directly into an ordered pair (Table IIa, column 2) consists of 2 multiplied by a composite number p1 (as a sum of numbers) or 4 multiplied by a prime p2 (as a sum of numbers) (see column 1, Table IIa). The only table values that are congruent to 393(mod 1564) and less than 1564 are:

x = ±317, ±363, ±419, ±465, ±1099, ±1145, ±1201, ±1247

These values are obtained by applying the algorithm to 4(391) and 391(4), where the second number is composed of a sum totaling that number and using the initial value of x = 317 (see Table I):

Table I (p=1564, r=393)
4(391)(a,b)317+a317−b391(4)(c,d)317+c317−d
4(0+391)(0,1564)317−1247
........
4(37+354)(148,1416)465−1099391(1+3)(391,1173)
....391(2+2)(782,782)1099−465
4(207+184)(828,736)1145−419391(3+1)(1173,391)
........
4(221+170)(884,680)1201−363

As one can see all the x terms in one form or the other (positive/negative) are produced.

Table of Valid Pairs

Table IIa shows a list of all the valid terms of p = 1564, r = 393. Column two shows the ordered pairs that are required to produce each term in column 2 and 3 when 317 is added to a or 317 subtracts b. If the pn (= 2 or 4) divides a and b of the ordered pair, only those numbers that are congruent to 0(mod pn) are present in the tables where pn is 2 or pn is 4. Note o denotes present and × not present in the tables consisting of each pn (Tables IIb and IIc). Note that in column one of Table IIa, n may be 1 or 2.

Table IIa (p=1564, r=393)
2n(1564/2n)(a,b)317+a317−bpn=2pn=4
4(0+391)(0,1564)317−1247×o
2(23+759)(46,1518)363−1201o×
2(51+731)(102,1462)419−1145o×
4(37+354)(148,1416)465−1099×o
2(391+391)(782,782)1099−465o×
4(207+184)(828,736)1145−419×o
4(221+170)(884,680)1201−363×o
2(465+317)(930,634)1247−317o×
Table IIb (p=1564, r=393)
2(782)(a,b)317+a317−b
2(23+759)(46,1518)363−1201
2(51+731)(102,1462)419−1145
2(391+391)(782,782)1099−465
2(465+317)(930,634)1247−317
Table IIc (p=1564, r=393)
4(391)(a,b)317+a317−b
4(0+391)(0,1564)317−1247
4(37+354)(148,1416)465−1099
4(207+184)(828,736)1145−419
4(221+170)(884,680)1201−363

Note that Table IIc corresponds to the left half of Table I.

Thus, while all the x values are present in Table Ia they are split up so that half go into Table IIa and the opposite x values go into Table IIb. Each table can, therefore, reproduce all the x values in either of their ± forms. So when a search is done using pn using either 1 or 2 for the value of n one is assured that half of all the x terms will be captured. To get the other half just flip the polarities of each x term obtained.

x values for p = 391

Since 391 = 17×23 Table III will consist 23(17) on the left and 17(23) on the right. Using 2(mod 391) as mentioned earlier and an initial x of 28 obtained by inspection from x2 = 282 = 2 + 391(2).

x = ±28, ±74, ±317, ±363, next higher values: ±419, ±465, ±708, ±754

where the only values in common with 393(mod 1564) are ±317, ±363, ±419 and ±465.

These values are obtained by applying the algorithm to 4(391) and 391(4), where the second number is composed of a sum totaling that number and using the initial value of x = 28 (see Table III):

Table III (p=391, r=393 ≡ 2(mod 391))
23(17)(a,b)28+a28−b17(23)(c,d)28+c28−d
23(0+17)(0,391)28−36317(0+23)(0,391)28−363
........
23(2+15)(46,345)74−31717(17+6)(289,102)317−74
........
23(17+0)(391,0)419−2817(23+0) (391,0)419−28

The result besides giving all the x values as positive or negative, also produces the next higher value of 419 in the sequence of numbers.

Go back to Part IVc Algorithm and Sequences from Quadratic Residues. Go to homepage.


Copyright © 2023 by Eddie N Gutierrez. E-Mail: enaguti1949@gmail.com