Skip to content

Instantly share code, notes, and snippets.

# prints lychrel candidate numbers up to 10000
lychrels = set()
not_lychrels = set()
seeds = set()
def is_palindrome(n):
n_str = str(n)
if n_str[::-1] == n_str:
return True
# displays alphanumeric character count and sum of digits in file
import sys
if len(sys.argv) < 2:
print "Usage: python charcount.py <input.txt>"
exit()
f = open(sys.argv[1])