Expanded Algorithm Involving Quadratic Residues (Part Ib)

Generation of many x and rs

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.

This page, however, will deal with only composite p.

Algorithm and Tables

This is a continuation of Part Ia where the composite number 105 is used to construct the tables according to the method of Part Ia. The values of x and r were set at 17 and 79, respectively, providing all the xs belonging to that residue (shown in bold). These xs are listed as follows as ± pairs (from square root of x).

x = ±17, ±32, ±38, ±52, ±53, ±67, ±73, ±88 and ±122

For instance, there are two or more r values for the majority of rs except for r = 30 in Table I and r = 49 in Table II (shown in red). The former correspond to four or more xs having the same r value while the latter correspond to only two x values per x. For p = 105 there are 44 xs that behave as nested pairs and eight which do not. The eight lowest x valuess (as absolute values) and their correponding r values in tuple format are:

(x,r)

(15,15), (20,85), (21,21), (30,60), (35,70), (42,84), (45,30), (50,85)

Using the computer program below and setting x = 1, r = 1, p1 = 1 and p = 105 gives all 105 possible values of x and r including the eight above. A table similar to those found on Part Ic would be the output.

To employ the algorithm one starts with an x which has been calculated from a known r, in this case x=17 from r=79. Columns 3 and 4 are used to generate the new values of x from columns 1 and 2. The residues (r) in column five are calculated from the new xs in columns three and four.

.
Table I (p=105, starting with r=79)
7(15)(a,b)17+a17−br
7(0+15)(0,105)17−88 79
7(1+14)(7,98)24−8151
7(2+13)(14,91)31−7416
7(3+12)(21,84)38−67 79
7(4+11)(28,77)45−6030
7(5+10)(35,70)52−53 79
7(6+9)(42,63)59−4616
7(7+8)(49,56)66−3951
7(8+7)(56,49)73−32 79
7(9+6)(63,42)80−25100
7(10+5)(70,35)87−189
7(11+4)(77,28)94−1116
7(12+3)(84,21)101−416
7(13+2)(91,14)10839
7(14+1)(98,7)11510100
7(15+0)(105,0)1221779
Table II (p=105, starting with r=79)
15(7)(a,b)17+a17−br
15(0+7)(0,105)17−8879
15(1+6)(15,90)32−7379
15(2+5)(30,75)47−584
15(3+4)(45,60)62−4364
15(4+3)(60,45)77−2849
15(5+2)(75,30)92−1364
15(6+1)(90,15)10724
15(7+0)(105,0)122 1779

Note that the difference between rs in Table I is 7 or multiples of 7 while those for Table II (except for rows 1 and 2) is 15 or multiples of 15, i.e., according to their p1 values of 7 and 15, respectively. We can change the values of x to 14 and r to 91 and use a JS computer program to perform the calculations. All the r values are different from those obtained in Table I, where the non nested 14th row, is (105,0), a tuple not listed above. So the method not only provides the tuples on the list but also the one, where x2 = 1052 ≡ 0 (mod 105) .

The absolute values of all the x values in Tables I and II, can be used to construct Table III where the xs are listed in ascending order based on their r values. The numbers in red correspond to those missing from Tables I and II and which may be calculated from 105 − xi, the lowest initial x.

Table III (p=105, r=variable)
rxixxxxxxx
7917323852537388122
5124396681
164113146597494101
304560
10010258095115
931887102108
424758103107
6413436292
492877

Note that the number of x values are less than p = 105 and that any values greater than p correspond to those xs in the next highest group.

Go to Part Ic Expanded Algorithm Involving Quadratic Residues. Go back to Part Ia. Go to homepage.


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