summaryrefslogtreecommitdiff
path: root/055.py
blob: d623d9b2aa6d27e56380713f8b5809f431e72681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

def lychrel(x):
	for i in xrange(50):
		t = x + int(str(x)[::-1])
		if t == int(str(t)[::-1]):
			return False
		x = t
	return True

count = 0

for i in xrange(1, 10000):
	if lychrel(i):
		count += 1

print count