- #1
ramsey2879
- 841
- 3
Can anyone find an exception to this test for odd P > 3?
P = Input an odd number > 3
Msg = "not Prime"
A = 4
B = 32
Do
C = B
B = Mod(6*C - A + 8,P)
A = C
If A = 4 Then
If B != 0 Then Exit Do
Else Msg = "Prime"
Exit Do
End If
End If
If B = 0 Then Exit Do
Loop
Print "P is" & Msg
End
Thanks, Ken Ramsey
P = Input an odd number > 3
Msg = "not Prime"
A = 4
B = 32
Do
C = B
B = Mod(6*C - A + 8,P)
A = C
If A = 4 Then
If B != 0 Then Exit Do
Else Msg = "Prime"
Exit Do
End If
End If
If B = 0 Then Exit Do
Loop
Print "P is" & Msg
End
Thanks, Ken Ramsey