Skip to content

Instantly share code, notes, and snippets.

@staccDOTsol
Created November 11, 2020 18:31
Show Gist options
  • Save staccDOTsol/c743eda0363e988f4f9358f07bf8efe6 to your computer and use it in GitHub Desktop.
Save staccDOTsol/c743eda0363e988f4f9358f07bf8efe6 to your computer and use it in GitHub Desktop.
def powers(num):
if num > 1:
for i in range(2,num):
if (num % i) == 0:
#print(num,"is not a prime number")
#print(i,"times",num//i,"is",num)
return(powers(num+1))
else:
print(str(num) + " is a prime number")
return(num)
else:
print(num,"is <= 1, not a prime number")
return(powers(num+1))
greatestprime = -1
while True:
greatestprime = powers(greatestprime + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment