OFFSET
0,4
COMMENTS
a(0)=a(1)=1 because the product over the empty set is defined here as 1. For S to be a prime, the positive integers <= n, except 1 and the primes > n/2, must all be together in either {b(k)} or {c(k)}. If p is a prime where n/2 < p <= n, then it is possible that p is in either product of the S sum, as can 1.
EXAMPLE
For n = 5 we have the primes 23 = 1*2*4 + 3*5, 29 = 1*2*3*4 + 5, 43 = 1*2*4*5 + 3, so a(5)=3.
MATHEMATICA
f[n_] := Block[{d = Divisors[Times @@ Select[Range[n], PrimeQ[ # ] && 2# > n &]]}, Select[Union[d + n!/d], PrimeQ]]; Length /@ Array[f, 100, 0]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler, Feb 18 2007
STATUS
approved