Skip to main content

Timeline for Is this number a prime?

Current License: CC BY-SA 3.0

5 events
when toggle format what by license comment
Sep 1, 2020 at 1:51 comment added Jeppe Stig Nielsen OK, that might be the correct interpretation, if you insist on reading with input() and writing with print(...). However, I thought a function like foo(x, y) = { z=bar(x); if(y, return(y*z)); z } or something was a "full program" in PARI/GP. It is not usual to do input() and print(...), more common to use return values (functional language).
Aug 31, 2020 at 16:46 comment added lynn @JeppeStigNielsen The challenge says: “Write a full program that …”
Aug 30, 2020 at 17:50 comment added Jeppe Stig Nielsen Why not i->isprime(i) or just isprime, that's shorter?
Sep 11, 2015 at 18:30 comment added DanaJ isprime does an APR-CL primality proof, so does slow down quite a bit as inputs get very large. ispseudoprime(input) does an AES BPSW probable prime test, which will be much faster for over 100 digits. Still no known counterexamples after 35 years. Version 2.1 and earlier of Pari, from pre-2002, uses a different method that can easily give false results, but nobody should be using that.
Sep 11, 2015 at 17:54 history answered lynn CC BY-SA 3.0