Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,13 @@
from math import factorial
def is_wprime(n):
return n == 2 or (
n > 1
and n % 2 != 0
and (factorial(n - 1) + 1) % n == 0
)
if __name__ == '__main__':
c = int(input('Enter upper limit: '))
print(f'Primes under {c}:')
print([n for n in range(c) if is_wprime(n)])