A042970 a(n) = binomial(n, floor(n/2)) mod n.
0, 0, 0, 2, 0, 2, 0, 6, 0, 2, 0, 0, 0, 2, 0, 6, 0, 2, 0, 16, 0, 2, 0, 4, 0, 2, 0, 20, 0, 0, 0, 6, 0, 2, 0, 24, 0, 2, 0, 20, 0, 6, 0, 28, 0, 2, 0, 12, 0, 2, 0, 32, 0, 20, 0, 0, 0, 2, 0, 4, 0, 2, 0, 6, 0, 42, 0, 40, 0, 42, 0, 52, 0, 2, 0, 44, 0, 20, 0, 20, 0, 2, 0, 0, 0, 2, 0, 48, 0, 0, 0, 52, 0, 2, 0
Offset: 1
Examples
a(10) = binomial(10,5) mod 10 = 252 mod 10 = 2.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Programs
-
Magma
[Binomial(n, Floor(n/2)) mod n: n in [1..110]]; // G. C. Greubel, Feb 17 2019
-
Maple
a:=n->modp(binomial(n,floor(n/2)),n): seq(a(n),n=1..110); # Muniru A Asiru, Feb 17 2019
-
Mathematica
Table[Mod[Binomial[n, Floor[n/2]], n], {n,1,110}] (* G. C. Greubel, Feb 17 2019 *)
-
PARI
a(n) = binomial(n, n\2) % n; \\ Michel Marcus, May 14 2018
-
Sage
[mod(binomial(n,floor(n/2)), n) for n in (1..110)] # G. C. Greubel, Feb 17 2019
Extensions
Name corrected by Jon E. Schoenfield, May 13 2018
Comments