Advertisement
nq1s788

12 c n

Mar 20th, 2024
564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. for n in range(4, 10000):
  2.     s = '5' + '2' * n
  3.     while ('52' in s) or ('2222' in s) or ('1122' in s):
  4.         if '52' in s:
  5.             s = s.replace('52', '11', 1)
  6.         if '2222' in s:
  7.             s = s.replace('2222', '5', 1)
  8.         if '1122' in s:
  9.             s = s.replace('1122', '25', 1)
  10.     if sum(map(int, s)) == 64:
  11.         print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement