login
a(n) = Sum_{k<n, k!==0 (mod n)} k!/n.
1

%I #6 Sep 03 2017 03:31:26

%S 1,0,0,0,0,25,0,738,5120,40908,0,3662892,0,482141160,6261884552,

%T 87600164760,0,21000656701120,0,6421274296759014,121967975910086640,

%U 2438739530264419200,0,1126236239013683565846,25899122858782713781248

%N a(n) = Sum_{k<n, k!==0 (mod n)} k!/n.

%C a(n)=0 if and only if n is a prime or n=4. - _Emeric Deutsch_, Aug 05 2005

%e a(9) = (6! + 7! + 8!)/9 = 5120.

%p a:=proc(n) local A, k: A:={}: for k from 0 to n-1 do if k! mod n = 0 then A:=A union {k} else A:=A: fi od: sum(A[j]!,j=1..nops(A))/n end: seq(a(n),n=1..27); # _Emeric Deutsch_, Aug 05 2005

%K easy,nonn

%O 1,6

%A _Amarnath Murthy_, Aug 01 2005

%E More terms from _Emeric Deutsch_, Aug 05 2005