OFFSET
1,6
COMMENTS
By Wolstenholme's theorem, when n>3 is prime and cb(n) is the central binomial coefficient A000984(n), then cb(n)-2 is divisible by n^3. This implies that it is also divisible by n^e for e=1,2 and 3, but not necessarily for e=4. It follows also that cn(n)-2, with cn(n)=cb(n)/(n+1) being the n-th Catalan number A000108(n), is divisible by any prime n. In fact, for any n>0, cn(n)-2 = (n+1)cb(n)-2 implies (cn(n)-2) mod n = (cb(n)-2) mod n = a(n). The sequence a(n) is of interest as a prime-testing sequence similar to Fermat's, albeit not a practical one until/unless an efficient algorithm to compute moduli of binomial coefficients is found. For more info, see A246131 through A246134.
LINKS
Stanislav Sykora, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Central Binomial Coefficient
Wikipedia, Wolstenholme's theorem
FORMULA
For any prime p, a(p)=0.
EXAMPLE
a(7)=0 because cb(7)-2 = binomial(14,7) -2 = 3432-2 = 490*7. Check also that cn(7) = 3432/8 = 429 and 429-2 = 61*7 so that (cn(7)-2) mod 7 = 0.
PROG
(PARI) a(n) = (binomial(2*n, n)-2)%n
CROSSREFS
KEYWORD
nonn
AUTHOR
Stanislav Sykora, Aug 16 2014
STATUS
approved