Created
April 17, 2018 13:40
-
-
Save eliannelavoie/3d32698f36ee7cf45126ec170cb6d88b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
def isPentagonal(n): | |
return (1/6*(sqrt(24*n+1)+1)).is_integer() | |
i = 40756 | |
while True: | |
h = i*(2*i-1) | |
if (isPentagonal(h)): | |
print(h) | |
break; | |
i+=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment