Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 3n+2
- def rule(x):
- if x == 2:
- return True
- return rule(x-3) if x > 2 else False
- """
- 2 \in S
- n \in S
- _______
- (n+3) \in S
- """
- # 2n+3m+1
- def rule2(x):
- if x == 1:
- return True
- return rule2(x-2) or rule2(x-3) if x > 1 else False
- """
- 1 \in S
- n \in S
- _________
- (n+2) \in S
- m \in S
- _________
- (m+3) \in S
- """
- # (n, 2n+1)
- def rule3(x):
- if x == (0, 1):
- return True
- return rule3((x[0]-1, x[1]-2)) if x[0] > 0 else False
- """
- (0, 1) \in S
- (n, m) \in S
- ____________
- (n+1, m+1) \in S
- """
- # (n, n*n)
- def rule4(x):
- if x == (0, 0):
- return True
- return rule4((x[0]-1, x[1]-2*x[0]+1)) if x[0] > 0 else False
- """
- (0, 0) \in S
- (n, m) \in S
- ____________
- (n+1, m+2*n+1) \in S
- """
- ______________________________________
- 1.2
- """
- (0, 1) \in S
- (n, k) \in S
- ____________
- (n+1, k+7) \in S
- """
- # (n, 7n+1) -> (0, 1), (1, 8), (2, 15), (3, 22)...
- """
- (0, 1) \in S
- (n, k) \in S
- ____________
- (n+1, 2k) \in S
- """
- # (n, 2^n) \in S -> (0, 1), (1, 2), (2, 4), (3, 8)
- """
- (0, 0, 1) \in S
- (n, i, j) \in S
- _______________
- (n+1, j, i+j) \in S
- """
- # fibonacci
- """
- (0, 1, 0) \in S
- (n, i, j) \in S
- _______________
- (n+1, i+2, i+j) \in S
- """
- # (n, 2n+1, n^2)
- ______________________________________
- 1.3
- """
- 0 \in S
- 1 \in S
- n \in S
- _______
- (n+3) \in S
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement