The Pocklington algorithm is a technique for solving a congruent equation of the form
- {\ displaystyle x ^ {2} \ equiv a {\ pmod {p}}, \,}

where x and a are integers and a is a quadratic residue .
The algorithm is one of the first effective methods for solving such an equation. The algorithm described by in 1917 [1] .
Content
Algorithm( Note : All Signs {\ displaystyle \ equiv} mean {\ displaystyle {\ pmod {p}}} unless otherwise stated.)
Entrance:
- p , odd prime
- a , an integer that is a binary residue {\ displaystyle {\ pmod {p}}} .
Output:
- x , integer satisfying identity {\ displaystyle x ^ {2} \ equiv a} . Note that if x is a solution, then - x is also a solution and, since p is odd, {\ displaystyle x \ neq -x} . Thus, there is always a second solution, if at least one is found.
Solution Method
Pocklington considers 3 different cases for p :
The first case is {\ displaystyle p = 4m + 3} , with {\ displaystyle m \ in \ mathbb {N}} , the decision is equal {\ displaystyle x \ equiv \ pm a ^ {m + 1}} .
Second case if {\ displaystyle p = 8m + 5} , with {\ displaystyle m \ in \ mathbb {N}} and
- {\ displaystyle a ^ {2m + 1} \ equiv 1} , the decision is equal {\ displaystyle x \ equiv \ pm a ^ {m + 1}} .
- {\ displaystyle a ^ {2m + 1} \ equiv -1} , 2 is not a (quadratic) residue, so {\ displaystyle 4 ^ {2m + 1} \ equiv -1} . It means that {\ displaystyle (4a) ^ {2m + 1} \ equiv 1} , so that {\ displaystyle y \ equiv \ pm (4a) ^ {m + 1}} is the solution {\ displaystyle y ^ {2} \ equiv 4a} . Consequently, {\ displaystyle x \ equiv \ pm y / 2} or, if y is odd, {\ displaystyle x \ equiv \ pm (p + y) / 2} .
Third case if {\ displaystyle p = 8m + 1} put {\ displaystyle D \ equiv -a} so the equation turns into {\ displaystyle x ^ {2} + D \ equiv 0} . Now by trial and error we find {\ displaystyle t_ {1}} and {\ displaystyle u_ {1}} such that {\ displaystyle N = t_ {1} ^ {2} -Du_ {1} ^ {2}} is not a quadratic residue. Next, let
- {\ displaystyle t_ {n} = {\ frac {(t_ {1} + u_ {1} {\ sqrt {D}}) ^ {n} + (t_ {1} -u_ {1} {\ sqrt {D }}) ^ {n}} {2}}}
- {\ displaystyle u_ {n} = {\ frac {(t_ {1} + u_ {1} {\ sqrt {D}}) ^ {n} - (t_ {1} -u_ {1} {\ sqrt {D }}) ^ {n}} {2 {\ sqrt {D}}}}} .
Now the following equalities hold:
- {\ displaystyle t_ {m + n} = t_ {m} t_ {n} + Du_ {m} u_ {n}}
- {\ displaystyle u_ {m + n} = t_ {m} u_ {n} + t_ {n} u_ {m}}
- {\ displaystyle t_ {n} ^ {2} -Du_ {n} ^ {2} = N ^ {n}} .
If p is {\ displaystyle 4m + 1} (which is true if p is {\ displaystyle 8m + 1} ), D is a quadratic residue and {\ displaystyle t_ {p} \ equiv t_ {1} ^ {p} \ equiv t_ {1}, \ quad u_ {p} \ equiv u_ {1} ^ {p} D ^ {(p-1) / 2 } \ equiv u_ {1}} . Now equality
- {\ displaystyle t_ {1} \ equiv t_ {p-1} t_ {1} + Du_ {p-1} u_ {1}}
- {\ displaystyle u_ {1} \ equiv t_ {p-1} u_ {1} + t_ {1} u_ {p-1}}
give a solution {\ displaystyle t_ {p-1} \ equiv 1, \ quad u_ {p-1} \ equiv 0} .
Let be {\ displaystyle p-1 = 2r} . Then {\ displaystyle 0 \ equiv u_ {p-1} \ equiv 2t_ {r} u_ {r}} . That means either {\ displaystyle t_ {r}} either {\ displaystyle u_ {r}} divided by p . If is divided {\ displaystyle u_ {r}} put {\ displaystyle r = 2s} and carry out similar calculations with {\ displaystyle 0 \ equiv 2t_ {s} u_ {s}} . Not all {\ displaystyle u_ {i}} divided by p so {\ displaystyle u_ {1}} not divided. Happening {\ displaystyle u_ {m} \ equiv 0} with odd m is impossible because it is executed {\ displaystyle t_ {m} ^ {2} -Du_ {m} ^ {2} \ equiv N ^ {m}} and that should mean that {\ displaystyle t_ {m} ^ {2}} congruently non-counting quadratic, obtained a contradiction. Thus, the cycle is interrupted when {\ displaystyle t_ {l} \ equiv 0} for some l . This gives {\ displaystyle -Du_ {l} ^ {2} \ equiv N ^ {l}} as well {\ displaystyle -D} is a square residue, l must be even. Set {\ displaystyle l = 2k} . Then {\ displaystyle 0 \ equiv t_ {l} \ equiv t_ {k} ^ {2} + Du_ {k} ^ {2}} . So, solving the equation {\ displaystyle x ^ {2} + D \ equiv 0} we obtain by solving a linear equation {\ displaystyle u_ {k} x \ equiv \ pm t_ {k}} .
ExamplesBelow are 3 examples corresponding to 3 different cases. In the examples all signs {\ displaystyle \ equiv} means modulo comparison .
Example 1
Solve the congruent equation
- {\ displaystyle x ^ {2} \ equiv 18 {\ pmod {23}}.}
The modulus is 23. Because {\ displaystyle 23 = 4 \ cdot 5 + 3} , {\ displaystyle m = 5} . Solutions must be values {\ displaystyle x \ equiv \ pm 18 ^ {6} \ equiv \ pm 8 {\ pmod {23}}} , and these are really solutions: {\ displaystyle (\ pm 8) ^ {2} \ equiv 64 \ equiv 18 {\ pmod {23}}} .
Example 2
Solve the congruent equation
- {\ displaystyle x ^ {2} \ equiv 10 {\ pmod {13}}.}
The modulus is 13. Because {\ displaystyle 13 = 8 \ cdot 1 + 5} , {\ displaystyle m = 1} . Check that {\ displaystyle 10 ^ {2m + 1} \ equiv 10 ^ {3} \ equiv -1 {\ pmod {13}}} . So the solution will be {\ displaystyle x \ equiv \ pm y / 2 \ equiv \ pm (4a) ^ {2} / 2 \ equiv \ pm 800 \ equiv \ pm 7 {\ pmod {13}}} . And these are really solutions: {\ displaystyle (\ pm 7) ^ {2} \ equiv 49 \ equiv 10 {\ pmod {13}}} .
Example 3
Solve the congruent equation {\ displaystyle x ^ {2} \ equiv 13 {\ pmod {17}}} . We write the equation in the form {\ displaystyle x ^ {2} -13 = 0} . First we find {\ displaystyle t_ {1}} and {\ displaystyle u_ {1}} such that {\ displaystyle t_ {1} ^ {2} + 13u_ {1} ^ {2}} is a quadratic non-reading. Take, for example, {\ displaystyle t_ {1} = 3, u_ {1} = 1} . Find {\ displaystyle t_ {8}} , {\ displaystyle u_ {8}} starting with
- {\ displaystyle t_ {2} = t_ {1} t_ {1} + 13u_ {1} u_ {1} = 9-13 = -4 \ equiv 13 {\ pmod {17}}, \,} ,
- {\ displaystyle u_ {2} = t_ {1} u_ {1} + t_ {1} u_ {1} = 3 + 3 \ equiv 6 {\ pmod {17}}. \,}
We continue in the same way {\ displaystyle t_ {4} = - 299 \ equiv 7 {\ pmod {17}} \, u_ {4} = 156 \ equiv 3 {\ pmod {17}}} , {\ displaystyle t_ {8} = - 68 \ equiv 0 {\ pmod {17}} \, u_ {8} = 42 \ equiv 8 {\ pmod {17}}.}
Insofar as {\ displaystyle t_ {8} = 0} get {\ displaystyle 0 \ equiv t_ {4} ^ {2} + 13u_ {4} ^ {2} \ equiv 7 ^ {2} -13 \ cdot 3 ^ {2} {\ pmod {17}}} that leads to the equation {\ displaystyle 3x \ equiv \ pm 7 {\ pmod {17}}} . The latter has solutions {\ displaystyle x \ equiv \ pm 8 {\ pmod {17}}} . Really, {\ displaystyle (\ pm 8) ^ {2} = 64 \ equiv 13 {\ pmod {17}}} .
Notes- ↑ Pocklington, 1917 , p. 57–58.
Literature- HC Pocklington. The direct solution of the quadratic and cubic binomial congruences with prime moduli // Proceedings of the Cambridge Philosophical Society. - 1917. - T. 19 .