Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. # 3n+2
  2. def rule(x):
  3. if x == 2:
  4. return True
  5. return rule(x-3) if x > 2 else False
  6. """
  7. 2 \in S
  8.  
  9. n \in S
  10. _______
  11. (n+3) \in S
  12. """
  13.  
  14. # 2n+3m+1
  15. def rule2(x):
  16. if x == 1:
  17. return True
  18. return rule2(x-2) or rule2(x-3) if x > 1 else False
  19.  
  20. """
  21. 1 \in S
  22.  
  23. n \in S
  24. _________
  25. (n+2) \in S
  26.  
  27. m \in S
  28. _________
  29. (m+3) \in S
  30. """
  31.  
  32. # (n, 2n+1)
  33. def rule3(x):
  34. if x == (0, 1):
  35. return True
  36. return rule3((x[0]-1, x[1]-2)) if x[0] > 0 else False
  37.  
  38. """
  39. (0, 1) \in S
  40.  
  41. (n, m) \in S
  42. ____________
  43. (n+1, m+1) \in S
  44. """
  45.  
  46. # (n, n*n)
  47. def rule4(x):
  48. if x == (0, 0):
  49. return True
  50. return rule4((x[0]-1, x[1]-2*x[0]+1)) if x[0] > 0 else False
  51.  
  52. """
  53. (0, 0) \in S
  54.  
  55. (n, m) \in S
  56. ____________
  57. (n+1, m+2*n+1) \in S
  58. """
  59.  
  60. ______________________________________
  61.  
  62. 1.2
  63.  
  64. """
  65. (0, 1) \in S
  66.  
  67. (n, k) \in S
  68. ____________
  69. (n+1, k+7) \in S
  70. """
  71. # (n, 7n+1) -> (0, 1), (1, 8), (2, 15), (3, 22)...
  72.  
  73. """
  74. (0, 1) \in S
  75.  
  76. (n, k) \in S
  77. ____________
  78. (n+1, 2k) \in S
  79. """
  80. # (n, 2^n) \in S -> (0, 1), (1, 2), (2, 4), (3, 8)
  81.  
  82. """
  83. (0, 0, 1) \in S
  84.  
  85. (n, i, j) \in S
  86. _______________
  87. (n+1, j, i+j) \in S
  88. """
  89. # fibonacci
  90.  
  91. """
  92. (0, 1, 0) \in S
  93.  
  94. (n, i, j) \in S
  95. _______________
  96. (n+1, i+2, i+j) \in S
  97. """
  98. # (n, 2n+1, n^2)
  99.  
  100. ______________________________________
  101.  
  102. 1.3
  103.  
  104. """
  105. 0 \in S
  106. 1 \in S
  107.  
  108. n \in S
  109. _______
  110. (n+3) \in S
  111. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement