Exemple #1
0
def findNthPrime(nth):
	n = 0
	current = 2
	while n < nth:
		n +=1
		while True:
			if checkPrime(current):
				current += 1
				break
			else:
				current += 1
	return current - 1
Exemple #2
0
def listPrimesToNth(nth):
	n = 0
	current = 2
	primes = []
	while n < nth:
		n +=1
		while True:
			if checkPrime(current):
				primes.append(current)
				current += 1
				break
			else:
				current += 1
	return primes