Tag Archives: prime number

Sieve of Eratosthenes : A basic implementation

An basic implementation to generate prime numbers by the Sieve of Eratosthenes method. Continue reading

Posted in Coding Discussions, Computer Science | Tagged , , | 7 Comments

Generating Twin Primes, Cousin Primes and Sexy Primes

A solution to generate twin prime numbers: A twin prime is a set of two prime numbers whose absolute difference is 2. Let p1 and p2 primes such that p2 – p1 = 2, then the set { p1 , p2 } are twin primes. Continue reading

Posted in Coding Discussions, Computer Science | Tagged , , | 3 Comments