Talk:Miller–Rabin primality test: Difference between revisions
Content added Content deleted
(Pseudocode) |
(→Pari/GP: new section) |
||
Line 65: | Line 65: | ||
==Pseudocode in task description== |
==Pseudocode in task description== |
||
The pseudocode includes the line "for r = 1 .. s − 1". Where is r used?--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 17:26, 20 August 2019 (UTC) |
The pseudocode includes the line "for r = 1 .. s − 1". Where is r used?--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 17:26, 20 August 2019 (UTC) |
||
== Pari/GP == |
|||
An extension of Pari code thru consecutive bases, where sprp is per the article. Allows confirmation of 341550071728321 passing bases 2,3,5,7,11,13,17 as well as 3215031751 with 2,3,5,7 (OEIS A074773) eg MR(3215031751,2,7). |
|||
::''MR(n,blo,bhi)={prodd=1;ctr=0; |
|||
::forprime(b=blo,bhi,ctr+=1; |
|||
::prodd= prodd* sprp(n,b); \\SO, any 0 will clear it ... |
|||
::if(prodd==0,break)); |
|||
::print(prodd, " ",ctr);}'' |
|||
<br>--[[User:Billymacc|Billymacc]] ([[User talk:Billymacc|talk]]) 16:53, 13 July 2021 (UTC) |