This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def prs(n): | |
| """Input n>=6, Returns an array of primes, 2 <= p < n""" | |
| sieve = np.ones(n // 3 + (n % 6 == 2), dtype=np.bool_) | |
| sieve[0] = False | |
| for i in range(int(n**0.5) // 3 + 1): | |
| if sieve[i]: | |
| k = 3 * i + 1 | 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import division | |
| from random import random | |
| import numpy as np | |
| import pandas as pd | |
| """ | |
| Use regret-matching algorithm to play Scissors-Rock-Paper. | |
| """ | |