Skip to content

Instantly share code, notes, and snippets.

@elais
Created August 7, 2012 18:58
Show Gist options
  • Save elais/3288344 to your computer and use it in GitHub Desktop.
Save elais/3288344 to your computer and use it in GitHub Desktop.
Solution To Project Euler Problem #4
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