# Is there a simple formula for $\binom{2n}{n} \pmod{n^3}$?

Is there a simple formula for the following? $$f(n) = \binom{2n}{n} \pmod{n^3}$$

I know $$f(n) = 2$$ iff $$n$$ is prime and greater than $$3$$, but I don't know anything about composite numbers.

• $f(n)=2$ iff $n$ is prime? Not true for $n=2$ or $3$. – Robert Israel Jan 11 '19 at 19:54
• Apologies, should be primes greater than 3. – Ben Crossley Jan 11 '19 at 20:25
• Might help to look for papers that generalize Lucas's theorem. – DanielV Jan 11 '19 at 21:40
• I first observed this by using Lucas's theorem (though I didn't know it by name) if we take the squares of row n of binomial triangle and sum them this gives $\binom{2n}{n}$ Then by Lucas theorem if we take away 2 it must be divisible by $n^2$ For reasons I dont know this can be increased to $n^3$ for primes greater than 3. – Ben Crossley Jan 11 '19 at 23:06
• For $p$ prime, $p>3$, ${2p \choose p} \equiv 2 \bmod p^3$ is just a reformulation of Wolstenholme Theorem. – René Gy Jan 12 '19 at 13:56