<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/index.php?action=history&amp;feed=atom&amp;title=Truncated_5-cubes</id>
	<title>Truncated 5-cubes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/index.php?action=history&amp;feed=atom&amp;title=Truncated_5-cubes"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Truncated_5-cubes&amp;action=history"/>
	<updated>2026-05-29T16:26:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0-wmf.28</generator>
	<entry>
		<id>https://en.formulasearchengine.com/index.php?title=Truncated_5-cubes&amp;diff=25247&amp;oldid=prev</id>
		<title>en&gt;Tomruen: /* Bitruncated 5-cube */</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=Truncated_5-cubes&amp;diff=25247&amp;oldid=prev"/>
		<updated>2014-01-25T21:28:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Bitruncated 5-cube&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Pocklington&amp;#039;s algorithm&amp;#039;&amp;#039;&amp;#039; is a technique for solving a congruence of the form&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;x^2 \equiv a \pmod p, \, &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;#039;&amp;#039;x&amp;#039;&amp;#039; and &amp;#039;&amp;#039;a&amp;#039;&amp;#039; are integers and &amp;#039;&amp;#039;a&amp;#039;&amp;#039; is a [[quadratic residue]].&lt;br /&gt;
&lt;br /&gt;
The algorithm is one of the first efficient methods to solve such a congruence. It was described by [[Henry Cabourn Pocklington|H.C. Pocklington]] in 1917.&amp;lt;ref&amp;gt;H.C. Pocklington, Proceedings of the Cambridge Philosophical Society, Volume 19, pages 57–58&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==The algorithm==&lt;br /&gt;
(Note: all &amp;lt;math&amp;gt;\equiv&amp;lt;/math&amp;gt; are taken to mean &amp;lt;math&amp;gt;\pmod p&amp;lt;/math&amp;gt;, unless indicated otherwise.)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Inputs:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;p&amp;#039;&amp;#039;, an odd [[Prime_number|prime]]&lt;br /&gt;
* &amp;#039;&amp;#039;a&amp;#039;&amp;#039;, an integer which is a quadratic residue &amp;lt;math&amp;gt;\pmod p&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Outputs:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;x&amp;#039;&amp;#039;, an integer satisfying &amp;lt;math&amp;gt;x^2 \equiv a&amp;lt;/math&amp;gt;. Note that if &amp;#039;&amp;#039;x&amp;#039;&amp;#039; is a solution, &amp;amp;minus;&amp;#039;&amp;#039;x&amp;#039;&amp;#039; is a solution as well and since &amp;#039;&amp;#039;p&amp;#039;&amp;#039; is odd, &amp;lt;math&amp;gt;x \neq -x&amp;lt;/math&amp;gt;. So there is always a second solution when one is found.&lt;br /&gt;
&lt;br /&gt;
===Solution method===&lt;br /&gt;
Pocklington separates 3 different cases for &amp;#039;&amp;#039;p&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
The first case, if &amp;lt;math&amp;gt;p=4m+3&amp;lt;/math&amp;gt;, with &amp;lt;math&amp;gt;m \in \mathbb{N}&amp;lt;/math&amp;gt;, the solution is &amp;lt;math&amp;gt;x \equiv \pm a^{m+1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The second case, if &amp;lt;math&amp;gt;p=8m+5&amp;lt;/math&amp;gt;, with &amp;lt;math&amp;gt;m \in \mathbb{N}&amp;lt;/math&amp;gt; and&lt;br /&gt;
# &amp;lt;math&amp;gt;a^{2m+1} \equiv 1&amp;lt;/math&amp;gt;, the solution is &amp;lt;math&amp;gt;x \equiv \pm a^{m+1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
# &amp;lt;math&amp;gt;a^{2m+1} \equiv -1&amp;lt;/math&amp;gt;, 2 is a (quadratic) non-residue so &amp;lt;math&amp;gt;4^{2m+1} \equiv -1&amp;lt;/math&amp;gt;. This means that &amp;lt;math&amp;gt;(4a)^{2m+1} \equiv 1&amp;lt;/math&amp;gt; so &amp;lt;math&amp;gt;y \equiv \pm (4a)^{m+1}&amp;lt;/math&amp;gt; is a solution of &amp;lt;math&amp;gt;y^2 \equiv 4a&amp;lt;/math&amp;gt;. Hence &amp;lt;math&amp;gt;x \equiv \pm y/2&amp;lt;/math&amp;gt; or, if &amp;#039;&amp;#039;y&amp;#039;&amp;#039; is odd, &amp;lt;math&amp;gt;x \equiv \pm (p+y)/2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The third case, if &amp;lt;math&amp;gt;p=8m+1&amp;lt;/math&amp;gt;, put &amp;lt;math&amp;gt;D \equiv -a&amp;lt;/math&amp;gt;, so the equation to solve becomes &amp;lt;math&amp;gt;x^2 + D \equiv 0&amp;lt;/math&amp;gt;. Now find by trial and error &amp;lt;math&amp;gt;t_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; so that &amp;lt;math&amp;gt;N = t_1^2 - D u_1^2&amp;lt;/math&amp;gt; is a quadratic non-residue. Furthermore let&lt;br /&gt;
:&amp;lt;math&amp;gt;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}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
The following equalities now hold:&lt;br /&gt;
:&amp;lt;math&amp;gt;t_{m+n} = t_m t_n + D u_m u_n, \quad u_{m+n} = t_m u_n + t_n u_m \quad \mbox{and} \quad t_n^2 - D u_n^2 = N^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
Supposing that &amp;#039;&amp;#039;p&amp;#039;&amp;#039; is of the form &amp;lt;math&amp;gt;4m+1&amp;lt;/math&amp;gt; (which is true if &amp;#039;&amp;#039;p&amp;#039;&amp;#039; is of the form &amp;lt;math&amp;gt;8m+1&amp;lt;/math&amp;gt;), &amp;#039;&amp;#039;D&amp;#039;&amp;#039; is a quadratic residue and &amp;lt;math&amp;gt;t_p \equiv t_1^p \equiv t_1, \quad u_p \equiv u_1^p D^{(p-1)/2} \equiv u_1&amp;lt;/math&amp;gt;. Now the equations&lt;br /&gt;
: &amp;lt;math&amp;gt;t_1 \equiv t_{p-1} t_1 + D u_{p-1} u_1 \quad \mbox{and} \quad u_1 \equiv t_{p-1} u_1 + t_1 u_{p-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
give a solution &amp;lt;math&amp;gt;t_{p-1} \equiv 1, \quad u_{p-1} \equiv 0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;p-1 = 2r&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;0 \equiv u_{p-1} \equiv 2 t_r u_r&amp;lt;/math&amp;gt;. This means that either &amp;lt;math&amp;gt;t_r&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;u_r&amp;lt;/math&amp;gt; is divisible by &amp;#039;&amp;#039;p&amp;#039;&amp;#039;. If it is &amp;lt;math&amp;gt;u_r&amp;lt;/math&amp;gt;, put &amp;lt;math&amp;gt;r=2s&amp;lt;/math&amp;gt; and proceed similarly with &amp;lt;math&amp;gt;0 \equiv 2 t_s u_s&amp;lt;/math&amp;gt;. Not every &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; is divisible by &amp;#039;&amp;#039;p&amp;#039;&amp;#039;, for &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; is not. The case &amp;lt;math&amp;gt;u_m \equiv 0&amp;lt;/math&amp;gt; with &amp;#039;&amp;#039;m&amp;#039;&amp;#039; odd is impossible, because &amp;lt;math&amp;gt;t_m^2 - D u_m^2 \equiv N^m&amp;lt;/math&amp;gt; holds and this would mean that &amp;lt;math&amp;gt;t_m^2&amp;lt;/math&amp;gt; is congruent to a quadratic non-residue, which is a contradiction. So this loop stops when &amp;lt;math&amp;gt;t_l \equiv 0&amp;lt;/math&amp;gt; for a particular &amp;#039;&amp;#039;l&amp;#039;&amp;#039;. This gives &amp;lt;math&amp;gt;-D u_l^2 \equiv N^l&amp;lt;/math&amp;gt;, and because &amp;lt;math&amp;gt;-D&amp;lt;/math&amp;gt; is a quadratic residue, &amp;#039;&amp;#039;l&amp;#039;&amp;#039; must be even. Put &amp;lt;math&amp;gt;l = 2k&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;0 \equiv t_l \equiv t_k^2 + D u_k^2&amp;lt;/math&amp;gt;. So the solution of &amp;lt;math&amp;gt;x^2 + D \equiv 0&amp;lt;/math&amp;gt; is got by solving the linear congruence &amp;lt;math&amp;gt;u_k x \equiv \pm t_k&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following are 3 examples, corresponding to the 3 different cases in which Pocklington divided forms of &amp;#039;&amp;#039;p&amp;#039;&amp;#039;. All &amp;lt;math&amp;gt;\equiv&amp;lt;/math&amp;gt; are taken with the [[Modular_arithmetic|modulus]] in the example.&lt;br /&gt;
&lt;br /&gt;
===Example 1===&lt;br /&gt;
Solve the congruence&lt;br /&gt;
:&amp;lt;math&amp;gt;x^2 \equiv 18 \pmod {23}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The modulus is 23. This is &amp;lt;math&amp;gt;23 = 4 \cdot 5 + 3&amp;lt;/math&amp;gt;, so &amp;lt;math&amp;gt;m=5&amp;lt;/math&amp;gt;. The solution should be &amp;lt;math&amp;gt;x \equiv \pm 18^6 \equiv \pm 8\pmod {23}&amp;lt;/math&amp;gt;, which is indeed true: &amp;lt;math&amp;gt;(\pm 8)^2 \equiv 64 \equiv 18\pmod {23}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
Solve the congruence&lt;br /&gt;
:&amp;lt;math&amp;gt;x^2 \equiv 10 \pmod{13}.&amp;lt;/math&amp;gt;&lt;br /&gt;
The modulus is 13. This is &amp;lt;math&amp;gt;13 = 8 \cdot 1 + 5&amp;lt;/math&amp;gt;, so &amp;lt;math&amp;gt;m=1&amp;lt;/math&amp;gt;. Now verifying &amp;lt;math&amp;gt;10^{2m+1} \equiv 10^3 \equiv -1\pmod{13}&amp;lt;/math&amp;gt;. So the solution is &amp;lt;math&amp;gt;x \equiv \pm y/2 \equiv \pm (4a)^{2}/2 \equiv \pm 800 \equiv \pm 7\pmod{13}&amp;lt;/math&amp;gt;. This is indeed true: &amp;lt;math&amp;gt;(\pm 7)^2 \equiv 49 \equiv 10\pmod{13}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Example 3===&lt;br /&gt;
Solve the congruence &amp;lt;math&amp;gt;x^2 \equiv 13 \pmod {17}&amp;lt;/math&amp;gt;. For this, write &amp;lt;math&amp;gt;x^2 -13 =0&amp;lt;/math&amp;gt;. First find a &amp;lt;math&amp;gt;t_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;t_1^2 + 13u_1^2&amp;lt;/math&amp;gt; is a quadratic nonresidue. Take for example &amp;lt;math&amp;gt;t_1=3, u_1 = 1&amp;lt;/math&amp;gt;. Now find &amp;lt;math&amp;gt;t_8&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;u_8&amp;lt;/math&amp;gt; by computing&lt;br /&gt;
:&amp;lt;math&amp;gt;t_2 = t_1 t_1 + 13u_1u_1 = 9-13 = -4 \equiv 13\pmod {17},\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
:&amp;lt;math&amp;gt;u_2 = t_1u_1 + t_1u_1 = 3+3 \equiv 6\pmod {17}.\,&amp;lt;/math&amp;gt;&lt;br /&gt;
And similarly &amp;lt;math&amp;gt;t_4 = -299 \equiv 7 \pmod {17}\, u_4=156 \equiv 3\pmod {17}&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;t_8=-68 \equiv 0\pmod {17}\, u_8 = 42 \equiv 8\pmod {17}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;t_8 = 0&amp;lt;/math&amp;gt;, the equation &amp;lt;math&amp;gt; 0 \equiv t_4^2 + 13u_4^2 \equiv 7^2 - 13 \cdot 3^2\pmod {17}&amp;lt;/math&amp;gt; which leads to solving the equation &amp;lt;math&amp;gt;3x \equiv \pm 7\pmod {17}&amp;lt;/math&amp;gt;. This has solution &amp;lt;math&amp;gt;x \equiv \pm 8\pmod {17}&amp;lt;/math&amp;gt;. Indeed, &amp;lt;math&amp;gt;(\pm 8)^2 = 64 \equiv 13\pmod {17}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{number theoretic algorithms}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Modular arithmetic]]&lt;br /&gt;
[[Category:Number theoretic algorithms]]&lt;/div&gt;</summary>
		<author><name>en&gt;Tomruen</name></author>
	</entry>
</feed>