Carmichael 3 strong pseudoprimes: Difference between revisions

Content deleted Content added
Dinosaur (talk | contribs)
Dinosaur (talk | contribs)
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.
PPPWRITE =(MSG,2) P1,P2,P3, INT8(P1)*P2*P3 !This converts to INTEGER*8.Result!
PPP = PPP*P2*P3 !So the product is computed that way, without named conversion functions.
WRITE (MSG,2) P1,P2,P3, INT8(P1)*P2*P3 !Result!
2 FORMAT (3I6,I12)
END IF