Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Prime Number derivation sieve

Another strange title of the project which I came across. To keep things simpler, it’s an ancient algorithm for finding all prime numbers up to any given limit. It does so by interactively marking as composite (i.e. not prime) the multiples of each prime, starting with the multiples of 2. The author made this wonderful project for his sister, who will be teaching Mathematics in high school. It features an LED matrix along with its driver and of course an arduino.

sieve

The project was completely self-designed and that includes it covering box too which was design using a CAD tool. With the help of a 3-d printer, he designed the box after putting the sketch in a software called Ultimaker. Talking about the algorithm, it takes a square 2D array (in this case, let’s say of booleans), with each value originally set to true. Starting from 2, for every number that’s true, go through and set all multiples of that number to false. When you reach the end of the (outer) loop, all primes are true (and 1, which is not a prime, is true too, but it makes the array look prettier) and all composite numbers are false.

[..Source link..]

Bookmark the permalink.

One Comment

  1. // Prime number generator
    // Arduino
    // Author: Nick Gammon
    // Date: 8th October 2013

    http://www.gammon.com.au/forum/?id=12168&page=999

Comments are closed