Is there any algorithm or a technique to calculate how many prime numbers lie in a given closed interval [a1, an], knowing the values of a1 and an, with a1,an ∈ ℕ?
Example:
[2, 10] --> 4 prime numbers {2, 3, 5, 7}
[4, 12] --> 3 prime numbers {5, 7, 11}