Here is Python easy Solution


#1

Comment body goes here.def sieve(self, A):
l=[]
for num in range(2, A+ 1):
i = 1
max_div = math.floor(math.sqrt(num))
for i in range(2, 1 + max_div):
if(num % i == 0):
i = num
break;

        # If the number is prime then print it.
        if(i != num):
            l.append(num)
    return l