Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Pocklington's algorithm

From Wikipedia, the free encyclopedia

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

x2a(modp),{\displaystyle x^{2}\equiv a{\pmod {p}},}

wherex anda are integers anda is aquadratic residue.

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

The algorithm

[edit]

(Note: all{\displaystyle \equiv } are taken to mean(modp){\displaystyle {\pmod {p}}}, unless indicated otherwise.)

Inputs:

Outputs:

Solution method

[edit]

Pocklington separates 3 different cases forp:

The first case, ifp=4m+3{\displaystyle p=4m+3}, withmN{\displaystyle m\in \mathbb {N} }, the solution isx±am+1{\displaystyle x\equiv \pm a^{m+1}}.

The second case, ifp=8m+5{\displaystyle p=8m+5}, withmN{\displaystyle m\in \mathbb {N} } and

  1. a2m+11{\displaystyle a^{2m+1}\equiv 1}, the solution isx±am+1{\displaystyle x\equiv \pm a^{m+1}}.
  2. a2m+11{\displaystyle a^{2m+1}\equiv -1}, 2 is a (quadratic) non-residue so42m+11{\displaystyle 4^{2m+1}\equiv -1}. This means that(4a)2m+11{\displaystyle (4a)^{2m+1}\equiv 1} soy±(4a)m+1{\displaystyle y\equiv \pm (4a)^{m+1}} is a solution ofy24a{\displaystyle y^{2}\equiv 4a}. Hencex±y/2{\displaystyle x\equiv \pm y/2} or, ify is odd,x±(p+y)/2{\displaystyle x\equiv \pm (p+y)/2}.

The third case, ifp=8m+1{\displaystyle p=8m+1}, putDa{\displaystyle D\equiv -a}, so the equation to solve becomesx2+D0{\displaystyle x^{2}+D\equiv 0}. Now find by trial and errort1{\displaystyle t_{1}} andu1{\displaystyle u_{1}} so thatN=t12Du12{\displaystyle N=t_{1}^{2}-Du_{1}^{2}} is a quadratic non-residue. Furthermore, let

tn=(t1+u1D)n+(t1u1D)n2,un=(t1+u1D)n(t1u1D)n2D{\displaystyle t_{n}={\frac {(t_{1}+u_{1}{\sqrt {D}})^{n}+(t_{1}-u_{1}{\sqrt {D}})^{n}}{2}},\qquad u_{n}={\frac {(t_{1}+u_{1}{\sqrt {D}})^{n}-(t_{1}-u_{1}{\sqrt {D}})^{n}}{2{\sqrt {D}}}}}.

The following equalities now hold:

tm+n=tmtn+Dumun,um+n=tmun+tnumandtn2Dun2=Nn{\displaystyle t_{m+n}=t_{m}t_{n}+Du_{m}u_{n},\quad u_{m+n}=t_{m}u_{n}+t_{n}u_{m}\quad {\mbox{and}}\quad t_{n}^{2}-Du_{n}^{2}=N^{n}}.

Supposing thatp is of the form4m+1{\displaystyle 4m+1} (which is true ifp is of the form8m+1{\displaystyle 8m+1}),D is a quadratic residue andtpt1pt1,upu1pD(p1)/2u1{\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 the equations

t1tp1t1+Dup1u1andu1tp1u1+t1up1{\displaystyle t_{1}\equiv t_{p-1}t_{1}+Du_{p-1}u_{1}\quad {\mbox{and}}\quad u_{1}\equiv t_{p-1}u_{1}+t_{1}u_{p-1}}

give a solutiontp11,up10{\displaystyle t_{p-1}\equiv 1,\quad u_{p-1}\equiv 0}.

Letp1=2r{\displaystyle p-1=2r}. Then0up12trur{\displaystyle 0\equiv u_{p-1}\equiv 2t_{r}u_{r}}. This means that eithertr{\displaystyle t_{r}} orur{\displaystyle u_{r}} is divisible byp. If it isur{\displaystyle u_{r}}, putr=2s{\displaystyle r=2s} and proceed similarly with02tsus{\displaystyle 0\equiv 2t_{s}u_{s}}. Not everyui{\displaystyle u_{i}} is divisible byp, foru1{\displaystyle u_{1}} is not. The caseum0{\displaystyle u_{m}\equiv 0} withm odd is impossible, becausetm2Dum2Nm{\displaystyle t_{m}^{2}-Du_{m}^{2}\equiv N^{m}} holds and this would mean thattm2{\displaystyle t_{m}^{2}} is congruent to a quadratic non-residue, which is a contradiction. So this loop stops whentl0{\displaystyle t_{l}\equiv 0} for a particularl. This givesDul2Nl{\displaystyle -Du_{l}^{2}\equiv N^{l}}, and becauseD{\displaystyle -D} is a quadratic residue,l must be even. Putl=2k{\displaystyle l=2k}. Then0tltk2+Duk2{\displaystyle 0\equiv t_{l}\equiv t_{k}^{2}+Du_{k}^{2}}. So the solution ofx2+D0{\displaystyle x^{2}+D\equiv 0} is got by solving the linear congruenceukx±tk{\displaystyle u_{k}x\equiv \pm t_{k}}.

Examples

[edit]

The following are 4 examples, corresponding to the 3 different cases in which Pocklington divided forms ofp. All{\displaystyle \equiv } are taken with themodulus in the example.

Example 0

[edit]
x243(mod47).{\displaystyle x^{2}\equiv 43{\pmod {47}}.}

This is the first case, according to the algorithm,x43(47+1)/2=43122{\displaystyle x\equiv 43^{(47+1)/2}=43^{12}\equiv 2}, but thenx2=22=4{\displaystyle x^{2}=2^{2}=4} not 43, so we should not apply the algorithm at all. The reason why the algorithm is not applicable is that a=43 is a quadratic non residue for p=47.

Example 1

[edit]

Solve the congruence

x218(mod23).{\displaystyle x^{2}\equiv 18{\pmod {23}}.}

The modulus is 23. This is23=45+3{\displaystyle 23=4\cdot 5+3}, som=5{\displaystyle m=5}. The solution should bex±186±8(mod23){\displaystyle x\equiv \pm 18^{6}\equiv \pm 8{\pmod {23}}}, which is indeed true:(±8)26418(mod23){\displaystyle (\pm 8)^{2}\equiv 64\equiv 18{\pmod {23}}}.

Example 2

[edit]

Solve the congruence

x210(mod13).{\displaystyle x^{2}\equiv 10{\pmod {13}}.}

The modulus is 13. This is13=81+5{\displaystyle 13=8\cdot 1+5}, som=1{\displaystyle m=1}. Now verifying102m+11031(mod13){\displaystyle 10^{2m+1}\equiv 10^{3}\equiv -1{\pmod {13}}}. So the solution isx±y/2±(4a)2/2±800±7(mod13){\displaystyle x\equiv \pm y/2\equiv \pm (4a)^{2}/2\equiv \pm 800\equiv \pm 7{\pmod {13}}}. This is indeed true:(±7)24910(mod13){\displaystyle (\pm 7)^{2}\equiv 49\equiv 10{\pmod {13}}}.

Example 3

[edit]

Solve the congruencex213(mod17){\displaystyle x^{2}\equiv 13{\pmod {17}}}. For this, writex213=0{\displaystyle x^{2}-13=0}. First find at1{\displaystyle t_{1}} andu1{\displaystyle u_{1}} such thatt12+13u12{\displaystyle t_{1}^{2}+13u_{1}^{2}} is a quadratic nonresidue. Take for examplet1=3,u1=1{\displaystyle t_{1}=3,u_{1}=1}. Now findt8{\displaystyle t_{8}},u8{\displaystyle u_{8}} by computing

t2=t1t1+13u1u1=913=413(mod17),{\displaystyle t_{2}=t_{1}t_{1}+13u_{1}u_{1}=9-13=-4\equiv 13{\pmod {17}},}
u2=t1u1+t1u1=3+36(mod17).{\displaystyle u_{2}=t_{1}u_{1}+t_{1}u_{1}=3+3\equiv 6{\pmod {17}}.}

And similarlyt4=2997(mod17),u4=1563(mod17){\displaystyle t_{4}=-299\equiv 7{\pmod {17}},u_{4}=156\equiv 3{\pmod {17}}} such thatt8=680(mod17),u8=428(mod17).{\displaystyle t_{8}=-68\equiv 0{\pmod {17}},u_{8}=42\equiv 8{\pmod {17}}.}

Sincet8=0{\displaystyle t_{8}=0}, the equation0t42+13u42721332(mod17){\displaystyle 0\equiv t_{4}^{2}+13u_{4}^{2}\equiv 7^{2}-13\cdot 3^{2}{\pmod {17}}} which leads to solving the equation3x±7(mod17){\displaystyle 3x\equiv \pm 7{\pmod {17}}}. This has solutionx±8(mod17){\displaystyle x\equiv \pm 8{\pmod {17}}}. Indeed,(±8)2=6413(mod17){\displaystyle (\pm 8)^{2}=64\equiv 13{\pmod {17}}}.

References

[edit]
  • Leonard Eugene Dickson, "History Of The Theory Of Numbers" vol 1 p 222, Chelsea Publishing 1952
  1. ^H.C. Pocklington, Proceedings of the Cambridge Philosophical Society, Volume 19, pages 57–58
Primality tests
Prime-generating
Integer factorization
Multiplication
Euclideandivision
Discrete logarithm
Greatest common divisor
Modular square root
Other algorithms
  • Italics indicate that algorithm is for numbers of special forms
Retrieved from "https://en.wikipedia.org/w/index.php?title=Pocklington%27s_algorithm&oldid=955727513"
Categories:

[8]ページ先頭

©2009-2026 Movatter.jp