Skip to content

Instantly share code, notes, and snippets.

@ncalm
Created January 8, 2025 03:04
Show Gist options
  • Save ncalm/64e19e6da50b700d5f1db156bf4a44fc to your computer and use it in GitHub Desktop.
Save ncalm/64e19e6da50b700d5f1db156bf4a44fc to your computer and use it in GitHub Desktop.
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