Sequences from Quadratic Residues (Part I)

A Method for Generating New Sequences

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.

According to the formula when p = 11 the number of residues is 5 and we depict the corresponding x and r values from the residues in Table I:

Table I (Quadratic Residues)
x12345
r14953

Let us say that each column of numbers corresponds to either of three type of expressions:

Type I: x2 = r + pq; q=0. Thus x2 = r
Type II: x2 = r + pq; q=1. Thus x2 = r + p
Type III: x2 = r + pq; q>1

where q is the quotient and the values of r, r + p and r + pq in the above three types are perfect squares. Types I and II are easily determined. With large primes x2 can be difficult to find in Type III cases especially if q is unknown. However, a method named The Method of Excludents for obtaining x2 is known and is described in in pages 207-208 of Recreations in the Theory of Numbers by Albert H. Beiler (1966). In addition, a six line description in mathworld.wolfram.com-Excludents basically defines the method.

To determine the value of each type we take the square roots of p and 2p and use a floor function (also known as greatest integer) to convert the values to integers. Using p = 11 the following results are obtained:

Type I = ⌊p⌋ = 3 ⟺ columns 1,2,3
Type II = ⌊2p⌋ − ⌊p⌋ = 4 − 3 = 1 ⟺ column 4
Type III = (p − 1)/2 − (Type I + Type II) = 5 − 4 = 1 ⟺ column 5
and where (p − 1)/2 = ⌊(p×(p−1))/4

where the symbol ⌊y⌋ signifies a floor function, i.e, the largest integer less than or equal to y and where y in this case is p or 2p.
Accordingly, there are three numbers of Type I, one of Type II and one of Type III when p = 11.

There are three exceptions, however, when p are 3, 5 and 7, respectively:

For p = 3
Type I = ⌊3⌋ =1 ⟺ column 1
Type II & Type III = 0  since (3 − 1)/2 = 1

For p = 5
Type I = ⌊5⌋ = 2 ⟺ columns 1,2
Type II & Type III = 0  since (5 − 1)/2 = 2

For p = 7
Type I = ⌊7⌋ = 2 ⟺ columns 1,2
Type II = ⌊14⌋ − ⌊7⌋ = 3 − 2 = 1 ⟺ column 3
Type III = 0   since (7 − 1)/2 = 3

Sequences Derived from the x2

A sequence can be derived from each p with its corresponding r by (1) taking as the first element the lowest positive x0 and adding p to each subsequent element and −p to all prior elements as in rows 1 and 2 of Table II, then (2) taking the absolute values of |x| and rearranging with lowest to highest as in row four. Row three consists of two Δ values (Δ1 and Δ2) which are to be added to either of two adjacent elements and where Δ1 + Δ2 = p. In addition, in row four the sum of pairs starting with the first pair x0 and x-1 is equal to np, where n takes odd values, 1,3,5,.... Consequently, each element squared in the general sequence of table II is congruent to r (mod p), i.e., leaves no remainder on division by p. :

Table II (General Sequence for p, r)
Δ...-p-p-pppp ppp...
x...-x-2-x-1x0 x1x2x3x4 x5...
ΔsΔ1Δ2Δ1 Δ2Δ1Δ2 Δ1Δ29...
|x|x0x-1x1 x-2x2x-3 x3x-4x4...

Using a specific number for instance p = 11 having an r value of 1 we can generate Table III, where row 2 gives a sequence based on Δ = 11 and row 4 the rearranged sequence with Δ values of 9 and 2.

Table III (Sequence for p=11, r=1)
Δ...-11-11-11111111 111111...
x...-21-101 12212334 45...
Δs929292 929...
|x|110122123 323445 54...

The four other sequences |x| based on r values of 4, 9, 5 and 3 are shown in Table IV in that particular order:

Table IV (Sequence for p=11, r=4,9,5,3)
Δs74747 4747...
|x|291320 2431354246...
Δs56565 6565...
|x|381419 2530364147...
Δs38383 8383...
|x|471518 2629374048...
Δs110110110 1101...
|x|56161727 28383949...

The methods employed here also produce similar results with larger primes, viz, 1193 and 135287 see Part II.

Go back to homepage.


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