Definition
Wolstenholme's theorem states that:
where a
and b
are positive integers and p
is prime, and the big parentheses thingy is Binomial coefficient.
Task
To verify that, you will be given three inputs: a
, b
, p
, where a
and b
are positive integers and p
is prime.
Compute:
where a
and b
are positive integers and p
is prime, and the parentheses thingy is Binomial coefficient.
Specs
Since:
where and the parentheses thingy is Binomial coefficient.
You can assume that 2b <= a
Testcases
a b p output
6 2 5 240360
3 1 13 3697053
7 3 13 37403621741662802118325
.0
on the end, to really show that there's no leftover.from the division. \$\endgroup\$[240360]
(singleton array) be an acceptable output format? \$\endgroup\$