Hypocrite Number

mail@pastecode.io avatar
unknown
plain_text
13 days ago
619 B
1
Indexable
Never
import math as m

def checkPrime(x):
    divisible_count = 0
    for k in range(1, int(round(m.sqrt(x),0))+1):
        if x%k == 0:
            divisible_count += 1
    return divisible_count == 1

x = 20
primes = []
count = 0
i=2
while i>=2 and count < x:
    flag_prime = False
    if '1' in str(i) or '0' in str(i):
        i += 1
        continue
    isPrime = True
    for j in list(set(str(i))):
        if checkPrime(int(j)) == False:
            isPrime = False
            break
    if isPrime == True:
        primes.append(i)
        count += 1
    i += 1
print(primes)
primes[-1]
Leave a Comment