โ† Infosys questions

Count primes in a large range

Filed under Infosys

Count the number of prime numbers in a given range [L, R]. The range can be extremely large, with R up to 10^18. Efficiently calculate the prime counting function pi(x) for large values.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Infosys questions

Collected from public candidate posts and coding forums. Updated Nov 2026.