OFFSET
1,2
COMMENTS
With the exception of n=4, if n is composite, a(n) = 0. If n is prime, a(n) = n*(n-1). For example, a(11) = 11*10 = 110, a(41) = 41*40 = 1640. - Gary Detlefs, May 01 2010
FORMULA
MATHEMATICA
Table[Mod[n!, n^2], {n, 79}] (* or *)
Table[Which[n == 4, Mod[n!, n^2], PrimeQ@ n, n (n - 1), True, 0], {n, 79}] (* Michael De Vlieger, Oct 14 2016 *)
PROG
(PARI) a(n)=if(isprime(n), n*(n-1), if(n==4, 8, 0)) \\ Charles R Greathouse IV, Dec 14 2015
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
Roman Stawski, Jul 05 2002
STATUS
approved