Made lucas_pp run much faster using some modular arithmetic.