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 sys import stdout | |
| rs = [] | |
| qs = [' ',' '] | |
| xs = [1,0] | |
| ys = [0,1] | |
| def gcd(a, b): | |
| if(len(rs) is 0): | |
| rs.append(a) |
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 java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| public class PRNG { | |
| private long seed = 0; | |
| private final long mod = Integer.MAX_VALUE, | |
| seven_pow = (long)Math.pow(7, 5); | |
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 fractions import gcd | |
| import copy | |
| def get_relative_primes(number): | |
| # will hold all numbers that are relatively prime to number | |
| rel_primes = set() | |
| # Dictionary: key is primitive root | |
| # value is the set of powers mod number |
NewerOlder