Code example for BigInteger

Methods: multiply

0
        return mulN.divide(TWO);
    } 
 
    public BigInteger pentagonalNumber(long n) {
        BigInteger bigInteger = new BigInteger(Long.toString(n));
        BigInteger multiply = bigInteger.multiply(THREE);
        BigInteger subtract = multiply.subtract(BigInteger.ONE);
        BigInteger multiply1 = subtract.multiply(bigInteger);
        return multiply1.divide(TWO);
//        return n * (3 * n - 1) / 2; 
    } 
 
 
    public BigInteger hexagonalNumber(long n) {
        BigInteger bigInteger = new BigInteger(Long.toString(n));
        BigInteger multiply = bigInteger.multiply(TWO);
        BigInteger subtract = multiply.subtract(BigInteger.ONE);
        return subtract.multiply(bigInteger);
//        return n * (2 * n - 1); 
    } 
Connect your IDE to all the code out there  Get Codota for Java