Created
August 7, 2012 18:58
-
-
Save elais/3288344 to your computer and use it in GitHub Desktop.
Solution To Project Euler Problem #4
This file contains 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
import sys | |
import os | |
def main(): | |
count = 1 | |
big = 998 | |
while count != 0: | |
big -= 1 | |
front = str(big) | |
palindrome = int(front + front[::-1]) | |
for i in range(999, 99, -1): | |
x = palindrome % i | |
if x == 0: | |
y = palindrome / i | |
if y < 1000: | |
print y, i, palindrome | |
count = 0 | |
break | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment