>at the grocery store
>clerk processing my purchase with a windows xp machine
>asks if I've been down the office supply aisle
>give him the bertstare
>whiteboard walks up out of the office supply aisle
>Hey bitch nigga sum the primes up to two million NIGGA
>can't
>burst into treats
how would i even go about finding the primes in python
then what would i do
>>59788592def sumPrimes(n):
sum, sieve = 0, [True] * n
for p in range(2, n):
if sieve[p]:
sum += p
for i in range(p*p, n, p):
sieve[i] = False
return sum
print sumPrimes(2000000)
>>59788592sieve = [True] * 2000000 # Sieve is faster for 2M primes
def mark(sieve, x):
for i in xrange(x+x, len(sieve), x):
sieve[i] = False
for x in xrange(2, int(len(sieve) ** 0.5) + 1):
if sieve[x]: mark(sieve, x)
print sum(i for i in xrange(2, len(sieve)) if sieve[i])
>clerk processing my purchase with a windows xp machine
Hopefully you only paid with cash or a prepaid card.
mine runs windows 2000 professional, no joke.
on a scale of 69 to archimedes, how much of a meme would u say this thread is