Please clarify giving detailed explanation about upto what n, the algorithm discussed in the video will work?
Upper limit of n
Hello @ankitsinghix05,
We can only create an array of maximum size 10^7. So, the upper limit of N is 1e7.
The algorithm used to check prime has complexity = sqrt(prime),
N = sqrt(prime)
prime = N^2 = (1e7)^2 = 1e14
The largest prime that can be checked using this algorithm is 1e14.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.