Why is it printing True for n = 25?

Please ignore the wrong Indentation.

def sieve_check(n):

if n == 1 or n == 0:

  return "Number is not Prime"

mapped = [True for p in range(n+1)]

i = 2

while i * i <= n:

  if mapped[i] == True:

      for item in range(i**i , n+1, i):

          mapped[item] = False

  i += 1

return mapped[n] == True

you do understand that i**i = \large i^{i} ?

3 Likes

oh yeah gotcha, it will be i**2 . Thanks

You can instead like like the post.
Happy to Help!

1 Like

:joy: you’re literally asking for likes, why though

:rofl:

Yeah, but even I am replying for likes. That’s kinda true with almost everyone replying.:joy:

Well I’m afraid you’re mistaken my friend :rofl: :rofl:, what will those likes get you after all ?