#Lutece0474. How many primes
How many primes
Migrated from Lutece 474 How many primes
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of years is the question of primality. A prime number is a number that is has no proper factors (it is only evenly divisible by and itself). The first prime numbers are but they quickly become less frequent. One of the interesting questions is how dense they are in various ranges. Adjacent primes are two numbers that are both primes, but there are no other prime numbers between the adjacent primes. For example, are the only adjacent primes that are also adjacent numbers.
Your program is given numbers: and (), and you are to find how many primes between and .
Input
Each line of input will contain two positive integers, and , with . The difference between and will not exceed .
Output
For each and , print a number index the number of primes between and .
Samples
2 5
3
2 1000000
78498
Resources
recommend by liverliu