Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- def is_defined_reminder(array, i):
- return array[i - 2] % 10 == 2 and \
- array[i - 1] % 10 == 0 and \
- array[i] % 10 == 1
- array = list()
- array.append(2) # array[0]
- array.append(0) # array[1]
- array.append(1) # array[2]
- array.append(2 + 0 + 1) # array[3]
- i = 3 # index
- while(not is_defined_reminder(array, i)):
- array.append(array[i - 2] + array[i - 1] + array[i])
- i += 1
- print i, array[i]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement