Carmichael 3 strong pseudoprimes: Difference between revisions
Content deleted Content added
→{{header|EchoLisp}}: Add Fortran. |
m →{{header|Fortran}}: Agh. Remove detritus. |
||
Line 406:
61 421 12841 329769721
61 181 5521 60957361</pre>
Which turns out to be when the two terms have remainders of one. So, using the double MOD approach - which gives the same result for either style of MOD... <lang Fortran> LOGICAL FUNCTION ISPRIME(N) !Ad-hoc, since N is not going to be big...
INTEGER N !Despite this intimidating allowance of 32 bits...
INTEGER F !A possible factor.
Line 435:
IF (ISPRIME(P3)) THEN !Is it prime?
IF (MOD(P2*P3,P1 - 1).EQ.1) THEN !Yes! Final test.
2 FORMAT (3I6,I12)
END IF
|