Code example for BigInteger

Methods: gcdintValue

    public static int f(int x, int n){
        return (new Random(x)).nextInt(n);
    private static int gcdThing(int a, int b) {
    BigInteger b1 = new BigInteger(""+a); // there's a better way to do this. I forget.
    BigInteger b2 = new BigInteger(""+b);
    BigInteger gcd = b1.gcd(b2);
    return gcd.intValue();
Connect your IDE to all the code out there  Get Codota for Java