diff options
Diffstat (limited to '055.py')
| -rw-r--r-- | 055.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -0,0 +1,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 + |
