@qtip2001/

WindingWellgroomedProtocol

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from random import randint
import time

def isPrime(n):
  for a in range(2, int(n**(0.5))+1):
    if n%a == 0:
      return False
  return True

def findPrimes(n):
  x = randint(2**(n-1), 2**n)
  if x%2 == 0:
    x += 1
  while not isPrime(x):
    x+=2
  print(x)
  x+=2
  while not isPrime(x):
    x+=2
  print(x)


n= 48

start = time.perf_counter()
findPrimes(n)
findPrimes(n)
findPrimes(n)
end = time.perf_counter()

print(end-start)