Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def a(number, start):
- bool = True
- if start < number:
- if number % start == 0:
- bool = False
- else:
- bool = a(number, start + 1)
- return bool
- def b(n1, n2):
- result = 0
- if n2 > n1:
- pass
- else:
- if n2 == 0:
- result = 1
- else:
- if n2 == n1:
- result = 1
- else:
- result = b(n1 - 1, n2 - 1)
- result += b(n1 - 1, n2)
- return result
- def c(nr):
- result = 0
- if nr != 0:
- if nr < 3:
- result = 1
- else:
- result = c(nr - 1)
- result += c(nr - 2)
- result += 1
- result = result % 987654321
- return result
- def X(nr):
- result = c(nr)
- if result % 3 == 0:
- temp = Y(nr - 1)
- result = result + 1
- else:
- temp = Z(nr - 1)
- result = temp + result
- return result
- def Y(nr):
- result = b(nr, 5)
- if result % 7 == 0:
- temp = X(nr - 1)
- result = result + 1
- else:
- temp = Z(nr - 1)
- result = temp + result
- return result
- def Z(nr):
- result = 0
- bool = True
- if nr > 1 :
- bool = a(nr, 2)
- if bool:
- result = X(nr - 1) + 1
- else:
- result = Y(nr - 1)
- return result
- number = 8283840
- print Z(number)
Add Comment
Please, Sign In to add comment