login
A175624
a(n) = n! modulo n*(n+1)*(n+2)/3.
1
1, 2, 6, 24, 50, 48, 0, 0, 210, 120, 352, 168, 0, 0, 800, 288, 1122, 360, 0, 0, 2002, 528, 0, 0, 0, 0, 4032, 840, 4930, 960, 0, 0, 0, 0, 8400, 1368, 0, 0, 11440, 1680, 13202, 1848, 0, 0, 17250, 2208, 0, 0, 0, 0, 24752, 2808, 0, 0, 0, 0, 34162, 3480, 37760, 3720, 0, 0, 0, 0
OFFSET
1,2
COMMENTS
It appears that a(1)=1, a(2)=2, a(3)=6, and, for n>3, a(n) = n*(n+2) if n+1 is prime, else a(n) = n*(n+1)*(n+5)/6 if n+2 is prime, else a(n)=0. This has been verified for n up to 1000.
LINKS
MATHEMATICA
Table[Mod[(n!), (n^3 + 3 n^2 + 2 n)/3], {n, 100}] (* Vincenzo Librandi, Jul 10 2014 *)
PROG
(PARI) a(n) = n! % (n*(n+1)*(n+2)/3); \\ Michel Marcus, Jul 09 2014
(Magma)
[Factorial(n) mod (2*Binomial(n+2, 3)): n in [1..80]]; // G. C. Greubel, Apr 12 2024
(SageMath)
[factorial(n)%(2*binomial(n+2, 3)) for n in range(1, 81)] # G. C. Greubel, Apr 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Jul 27 2010
STATUS
approved