Truncated 5-cubes

From formulasearchengine
Jump to navigation Jump to search

Pocklington's algorithm is a technique for solving a congruence of the form

x2a(modp),

where x and a are integers and a is a quadratic residue.

The algorithm is one of the first efficient methods to solve such a congruence. It was described by H.C. Pocklington in 1917.[1]

The algorithm

(Note: all are taken to mean (modp), unless indicated otherwise.)

Inputs:

  • p, an odd prime
  • a, an integer which is a quadratic residue (modp).

Outputs:

  • x, an integer satisfying x2a. Note that if x is a solution, −x is a solution as well and since p is odd, xx. So there is always a second solution when one is found.

Solution method

Pocklington separates 3 different cases for p:

The first case, if p=4m+3, with m, the solution is x±am+1.

The second case, if p=8m+5, with m and

  1. a2m+11, the solution is x±am+1.
  2. a2m+11, 2 is a (quadratic) non-residue so 42m+11. This means that (4a)2m+11 so y±(4a)m+1 is a solution of y24a. Hence x±y/2 or, if y is odd, x±(p+y)/2.

The third case, if p=8m+1, put Da, so the equation to solve becomes x2+D0. Now find by trial and error t1 and u1 so that N=t12Du12 is a quadratic non-residue. Furthermore let

tn=(t1+u1D)n+(t1u1D)n2,un=(t1+u1D)n(t1u1D)n2D.

The following equalities now hold:

tm+n=tmtn+Dumun,um+n=tmun+tnumandtn2Dun2=Nn.

Supposing that p is of the form 4m+1 (which is true if p is of the form 8m+1), D is a quadratic residue and tpt1pt1,upu1pD(p1)/2u1. Now the equations

t1tp1t1+Dup1u1andu1tp1u1+t1up1

give a solution tp11,up10.

Let p1=2r. Then 0up12trur. This means that either tr or ur is divisible by p. If it is ur, put r=2s and proceed similarly with 02tsus. Not every ui is divisible by p, for u1 is not. The case um0 with m odd is impossible, because tm2Dum2Nm holds and this would mean that tm2 is congruent to a quadratic non-residue, which is a contradiction. So this loop stops when tl0 for a particular l. This gives Dul2Nl, and because D is a quadratic residue, l must be even. Put l=2k. Then 0tltk2+Duk2. So the solution of x2+D0 is got by solving the linear congruence ukx±tk.

Examples

The following are 3 examples, corresponding to the 3 different cases in which Pocklington divided forms of p. All are taken with the modulus in the example.

Example 1

Solve the congruence

x218(mod23).

The modulus is 23. This is 23=45+3, so m=5. The solution should be x±186±8(mod23), which is indeed true: (±8)26418(mod23).

Example 2

Solve the congruence

x210(mod13).

The modulus is 13. This is 13=81+5, so m=1. Now verifying 102m+11031(mod13). So the solution is x±y/2±(4a)2/2±800±7(mod13). This is indeed true: (±7)24910(mod13).

Example 3

Solve the congruence x213(mod17). For this, write x213=0. First find a t1 and u1 such that t12+13u12 is a quadratic nonresidue. Take for example t1=3,u1=1. Now find t8, u8 by computing

t2=t1t1+13u1u1=913=413(mod17),,
u2=t1u1+t1u1=3+36(mod17).

And similarly t4=2997(mod17)u4=1563(mod17) such that t8=680(mod17)u8=428(mod17).

Since t8=0, the equation 0t42+13u42721332(mod17) which leads to solving the equation 3x±7(mod17). This has solution x±8(mod17). Indeed, (±8)2=6413(mod17).

References

  1. H.C. Pocklington, Proceedings of the Cambridge Philosophical Society, Volume 19, pages 57–58

Template:Number theoretic algorithms