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
digon
7
you’re literally asking for likes, why though
Yeah, but even I am replying for likes. That’s kinda true with almost everyone replying.
digon
10
Well I’m afraid you’re mistaken my friend
, what will those likes get you after all ?