If A = {3, {4, 5}, 6}, find P(A) and n{P(A)}
Answers
Answer:
primeNo = [True for i in range(n+1)] # this is a boolean array
p = 2 # the first prime number is initialized as 2
while (p * p <= n): # enumerates all multiples of p
if (primeNo[p] == True):
for i in range(p * p, n+1, p): #update multiples
primeNo[i] = False
p = p + 1
for p in range(2, n): #display all the prime numbers
if primeNo[p]:
print(p),
def main(): #to take value of n from user and display prime numbers #less than or equal to n by calling Eratosthenes method
n= int(input("Enter an integer n: "))
print("The prime numbers less than or equal to",n, "are: ")
Eratosthenes(n)
Step-by-step explanation:
hope it's helpful to you ✌️✌️✌️✌️✌️
please mark me as brainlist and mark thanks.
Step-by-step explanation:
मुझे नहीं पता है sorry..