OFFSET
1,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000
EXAMPLE
51 - 0! = 51 - 1! = 50 is not prime. 51 - 2! = 49 is not prime. 51 - 3! = 45 is not prime. 51 - 4! = 27 is not prime. For k >= 5, 51 - k! is negative and thus not prime. Hence 51 is a member of this sequence since 51 - k! is not prime for any k.
PROG
(Python)
import sympy
from sympy import isprime
import math
def Prf(x):
..count = 0
..for i in range(x):
....if isprime(x-math.factorial(i)):
......count += 1
..return count
x = 1
while x < 10**3:
..if Prf(x) == 0:
....print(x)
..x += 1
(PARI) isok(n) = {k = 0; while (((nmk =(n - k!)) > 0), if (isprime(nmk), return (0)); k++; ); return (1); } \\ Michel Marcus, Mar 16 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 15 2014
STATUS
approved