login
a(n) = Sum_{composite c <= n} n!/c.
7

%I #10 Jun 30 2021 07:44:50

%S 6,30,300,2100,21840,236880,2731680,30048480,400498560,5206481280,

%T 79117758720,1273944672000,21690789120000,368743415040000,

%U 6993068898816000,132868309077504000,2779011281958912000,60792138929313792000,1388517998616612864000

%N a(n) = Sum_{composite c <= n} n!/c.

%H Michael S. Branicky, <a href="/A110374/b110374.txt">Table of n, a(n) for n = 4..449</a>

%e a(8) = 8! * (1/4 + 1/6 + 1/8) = 21840.

%p a:=proc(n) local s,i :s:=0: for i from 4 to n do if isprime(i)=false then s:=s+1/i else s:=s: fi od: n!*s; end; seq(a(n),n=4..23); # _Emeric Deutsch_, Jul 24 2005

%o (Python)

%o from sympy import factorial, isprime, Rational

%o def a(n): return factorial(n) * sum(Rational(1, c) for c in range(4, n+1) if not isprime(c))

%o print([a(n) for n in range(4, 23)]) # _Michael S. Branicky_, Jun 30 2021

%Y Cf. A110373.

%K easy,nonn

%O 4,1

%A _Amarnath Murthy_, Jul 24 2005

%E More terms from _Emeric Deutsch_, Jul 24 2005

%E a(21) and beyond from _Michael S. Branicky_, Jun 30 2021