Carmichael 3 strong pseudoprimes: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: changed/added comments and indentations, optimized some code.)
m (→‎{{header|REXX}}: optimized the isPrime function a wee bit.)
Line 1,100: Line 1,100:
/*──────────────────────────────────────────────────────────────────────────────────────*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
isPrime: procedure expose !.; parse arg x; if !.x then return 1
isPrime: procedure expose !.; parse arg x; if !.x then return 1
if x<31 then return 0; if x//2==0 then return 0; if x// 3==0 then return 0
if x<37 then return 0; if x//2==0 then return 0; if x// 3==0 then return 0
parse var x '' -1 _; if _==5 then return 0; if x// 7==0 then return 0
parse var x '' -1 _; if _==5 then return 0; if x// 7==0 then return 0
if x//11==0 then return 0; if x//13==0 then return 0
if x//11==0 then return 0; if x//13==0 then return 0