public BigInteger at ( int n ) { while ( a . size ( ) <= n ) { final int lastn = a . size ( ) - 1 ; final BigInteger nextn = BigInteger . valueOf ( lastn + 1 ) ; a . add ( a . get ( lastn ) . multiply ( nextn ) ) ; } return a . get ( n ) ; }
Compute the factorial of the non - negative integer .