Prime Numbers and Lucky Primes

Derivatives & Demons

I’ve always loved prime numbers, especially lucky primes. One of the coping mechanisms I frequently use to deal with anxiety is to generate lists of prime numbers in my head.

The sieve of Eratosthenes is the most effective way to generate a list of prime numbers (for values below 10,000 or so, anyway). To use this method:

  1. Create a list of consecutive integers.
  2. Let p=2 initially. 2 is the first prime number (1 doesn’t count).
  3. Starting from p, count up in increments of p and cross out those numbers.
  4. Find the next highest number in the list not previously crossed off, and count up by multiples of that number, crossing off each as you come to it.
  5. Repeat step 4 until there are no more numbers to cross off.
  6. The remaining numbers are prime.

Here’s an animation (courtesy wikipedia) that demonstrates this process:

Sieve of Eratosthenes animation

There is also a set…

View original post 149 more words


Posted on October 13, 2013, in Uncategorized. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: