Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Sieve of Eratosthenes

Name: Anonymous 2013-11-05 16:22

Do you guys like my sieve of eratosthenes?

https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes


print "2\n3\n5\n7"
for a in range(2, 121):
    if a % 2 != 0:
        if a % 3 != 0:
            if a % 5 != 0:
                if a % 7 != 0:
                    print a

Name: Anonymous 2013-11-05 17:32

I like it because it is witty and ironic because it doesn't work for numbers larger than 49 and it prints the first four primes twice.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List