New Algorithm Involving Quadratic Residues (Part IVa)

Sequences of x from known Quadratic Residues

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 Sequences

The x using known quadratic residues in Part IV were generated using the Chinese Remainder Theory on the web page of B. Ikenaga on Quadratic Residues. A newer algorithm has been found which basically does the same using an ordered pair to generate the x values as ± pairs. We start by setting p = 91 into the product of two odd primes (13×7) and generate Table I where:

  1. Find the lowest positive x
  2. Format the composite number 91 into 7(13)
  3. Convert the second number, 13, into (a + b) sums such that 7(a+b) = 91
  4. Distribute (Dstr) the first number, 7
  5. Convert the two numbers in the sum into ordered pairs
  6. Add the lowest positive x, obtained previously, to a
  7. Subtract b from x
  8. Find which two numbers on the list are congruent to 79(mod 91)
  9. Convert the first number, 7, into (c + d) sums and repeat the process

We can find x either via the Chinese Remainder Theory or using the equation x2 = r + pq. For r = 79 we can try various values of q and if we're lucky q can be low (in this case q = 6) whereby x2 = 79 + 91(6) = 625 = 252. A third option is to generate the number using a simple computer program if q appears to be out of reach.

We set up Table I according to the instructions and find that x = ±38 and ±53 are the only values besides 25 and a fourth number = 66. In addition, we could have employed x = −25 just as well since both are valid values for x. Moreover, when the ordered pairs are reversed the x values obtained (in red) are not congruent to 79(mod 91). The values in red, however, are values having different x values and it will be shown in Part Ia and Part Ib that the whole table can be filled with xs of different r values so that the method can be extended to generate a host of xs without knowing r.

Table I (p=91, r=79)
7(13)Dstr(a,b)25+a25−b13(7)Dstr(c,d)25+c25−d
7(1+12)7+84(7,84)
7(2+11)14+77(14,77)
7(3+10)21+70(21,70)
7(4+9)28+63(28,63)53-3813(1+6)13+78(13,78)38-53
7(5+8)35+56(35,56)13(2+5)26+65(26,65)
7(6+7)42+49(42,49)13(3+4)39+52(39,52)
7(7+6)49+42(49,42)13(4+3)52+39(52,39)
7(8+5)56+35(56,35)13(5+2)65+26(65,26)
7(9+4)63+28(63,28)88−313(6+1)78+13(78,13)103−15
7(10+3)70+21(70,21)
7(11+2)77+14(77,14)
7(12+1)84+7(84,7))

We can take the values obtained in Table I and generate a sequence by placing the negative numbers to the left and the positive to the right of x = 25 in Table II, where the negative numbers decrease without bound and the positives increase without bound. The Δ1 values in row one take on the corresponding ordered pair values (either ±) from Table I. If we take the absolute values of the xs in row two of Table II we can produce the sequence in row four starting with the lowest positive x. Since all terms in row four are positive the last term in the group could also have been generated as a positive value from 91 − 25. Moreover, the fourth Δ2 value in row four, is obtained by subtracting the sum of 13 + 15 + 13 from 91 affording 50, a connecting number that links adjacent groups. In addition, as stated in Part IV, the pattern for the sums of four terms/group in this sequence is p,3p,5p...

Table II (p=91, r=79)
Δ1-63-28-63 2863286328
x-129-66-3825 53116144207
Δ21315135013 151350
|x|25385366116 129144157

We can find x either via the Chinese Remainder Theory or using the equation x2 = r + pq. For r = 88 we find that q = 3 whereby x2 = 88 + 91(3) = 361 = 192. Repeating the algorithm for x = 19 affords x = ±33 and ±58:

Table III (p=91, r=88)
7(13)Dstr(a,b)19+a19−b13(7)Dstr(c,d)19+c19+−d
7(1+12)7+84(7,84)
7(2+11)14+77(14,77)33−58
7(3+10)21+70(21,70)
7(4+9)28+63(28,63)13(1+6)13+78(13,78)
7(5+8)35+56(35,56)13(2+5)26+65(26,65)
7(6+7)42+49(42,49)13(3+4)39+52(39,52)58−33
7(7+6)49+42(49,42)13(4+3)52+39(52,39)71−20
7(8+5)56+35(56,35)13(5+2)65+26(65,26)
7(9+4)63+28(63,28)13(6+1)78+13(78,13)
7(10+3)70+21(70,21)
7(11+2)77+14(77,42)96−23
7(12+1)84+7(84,7))

Repeating the process as above the x values ±33 and ±58 along with 19 and ±72 were inserted into Table IV giving the sequences on row two and four.

Table IV (Sequence for p=91, r=88)
Δ1-52-39-52 3952395239
x-124-72-3319 58110149201
Δ21425143814 251438
|x|19335872110 124149163

A good thing about this algorithm is that it allows us to use the same tables whenever p is kept constant and the least positive x is varied.

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


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