Sum-O-Primes

Challenge

We have so much faith in RSA we give you not just the product of the primes, but their sum as well!

Solution

Run the solution script.py, which uses the equations for p and p-q from this paper (Archive).

The two equations can be combined to form: p=(x+sqrt(x^2-4*n))/2.

gmpy2 is used to store large numbers and it's precision is set to 2048 ate the beginning of the script to ensure that no digits are lost.

Flag

picoCTF{3921def5}

Last updated