Skip to content

Instantly share code, notes, and snippets.

View apatrascu's full-sized avatar

Alecsandru Patrascu apatrascu

  • Bucharest, Romania
View GitHub Profile
from memory_profiler import profile
@profile(precision=6)
def primes(n):
if n == 2:
return [2]
elif n < 2:
return []
s = range(3, n + 1, 2)
import time
import statistics
def primes(n):
if n==2:
return [2]
elif n<2:
return []
s=range(3,n+1,2)
mroot = n ** 0.5