Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Factoring vs Prime identification

Hey folks,

I generated two random primes, using random_prime(2^256)

Which gave me:




Multiplying them to get a semiprime I get:


So maybe this is my miscomprehension, but when I try to run:

factor(on the semiprime) -- it takes a long time, never completing.

When I run

isPrime(on the semiprime) -- it instantly returns false.

If indeed sage generates proper primes (non pseudoprimes) how can isPrime be so efficient. Does verifying that a number ISNT prime, not require identifying a factor? If so, why does factorisation take so long?