Does anybody know a fast algorithm for calculating a large catalan number modulo a prime (which is 1.000.000.007) with an input value of about 500.000
Already spent quite some time on it but I wasn't able to modify the normal formular to work with that high numbers and the dynamic algorithm takes too long.
I'd be very grateful for any help :)