Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index = 0
- for i in range(5000000):
- if index == 5000:
- break
- t = str(i + 1)
- str_check = ''
- for j in range(len(t)):
- if str_check == '':
- if t[j] =='4':
- str_check = '4'
- continue
- else:
- str_check = ''
- elif str_check == '4':
- if t[j]=='2':
- str_check = '42'
- continue
- elif t[j] == '4':
- str_check = '4'
- else:
- str_check = ''
- elif str_check == '42':
- if t[j] =='0':
- str_check = ''
- print t
- index += 1
- break
- elif t[j] == '4':
- str_check = '4'
- else:
- str_check = ''
Add Comment
Please, Sign In to add comment