Skip to main content

Posts

Showing posts from October, 2019

Finding all Primes Up-to N using Sieve of Atkin

                                                                                                   -By: Sambhav Sieve of Atkin For Finding all Primes Up-to N. Hello Friends, Welcome to my other blog on competitive programming. Today, I am going to continue one advance mathematical concept that already we started in previous blog .As you might have already figured out that today’s we are going to discuss Sieve of primes using the Atkin’s approach. So, without wasting much time, let’s get started. The Sieve of Atkin is a modern algorithm for finding all prime numbers up to a specified integer. Compared with the ancient sieve of Eratosthenes , which marks off multiple of squares of primes, thus achieving a better theoretica...

Finding all Primes Up-to N using Sieve of Eratosthenes

                                                                                                   -By: Sambhav Sieve of Eratosthenes For Finding all Primes Up-to N. Hello Friends, Welcome to my first blog on competitive programming. Today, I am going to illuminate one fascinating mathematical concept that can give you an edge over others in coding contest. As you might have already figured out that today’s topic of discussion is about Sieve of primes using the Eratosthenes’s approach. So, without wasting much time, let’s get started. /* Before I tell you the Statement of the problem. Let us see what are prime numbers and how we can figure out whether a number is prime or not. */ A prime number is a whole number greater th...