Created
January 8, 2025 03:04
-
-
Save ncalm/64e19e6da50b700d5f1db156bf4a44fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
from sympy import divisor_sigma, isprime | |
import time | |
t1 = time.time() | |
results = [] | |
n = 1 | |
while len(results) < 50: | |
if n > 2 and isprime(n): | |
n += 1 | |
continue | |
sosf = divisor_sigma(n, 2) | |
if math.isqrt(sosf) ** 2 == sosf: | |
results.append(n) | |
n += 1 | |
print(time.time() - t1) | |
results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment