Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pali = ["1","2", "3", "4", "5", "6","7","8","9","11","22", "33", "44", "55", "66","77", "88", "99"]
- index =9
- while len(pali) < 10000:
- if len(pali[index])%2 ==0:
- for k in range(0,10):
- pali += [pali[index][:len(pali[index])//2] +str(k) +pali[index][len(pali[index])//2:]]
- pali += [pali[index][:len(pali[index])//2] +str(k)*2+pali[index][len(pali[index])//2:]]
- index += 1
- total = 0.0
- for i in range(0,len(pali)):
- total += 1/int(pali[i])
- print(total)
Add Comment
Please, Sign In to add comment