Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.3K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Almost thought I had a test for primality.

Posted 5 years ago

Test this out and see if you can find the flaw in the program

Clear[a, b, p]; k = 2^3217 - 1; p = 
 Solve[{(2 (1 + 2 k) (-k + a (1 + k - b)) b)/((-1 + a b) (2 k + 
       a b) (1 + 2 k + a b)) == 0, a > 0, b > 0}, {a, b}, 
  Integers]; p = FromDigits[Differences[Flatten[{a, b} /. p]]]; If[
 p == 0, Print[k, " <-Is Prime"], Print[k, " <- Is Not Prime"]]

try some values for k.

POSTED BY: Paul Cleary
2 Replies
Posted 5 years ago
POSTED BY: Paul Cleary
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard