Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import combinations_with_replacement as cp
- from itertools import permutations as p
- import gmpy2
- def is_prime(num):
- return gmpy2.is_prime(num) if num > 0 else False
- def get_total_primes(a, b):
- c=0
- for i in cp('2357',len(str(b))):
- q = int(''.join(i))
- if p in range(a,b) and is_prime(q):
- c+=1
- return c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement