[go: up one dir, main page]

login
A239321
Numbers n such that n - k! is never prime; or A175940(n) = 0.
2
1, 2, 10, 16, 22, 28, 34, 36, 40, 46, 50, 51, 52, 56, 57, 58, 64, 66, 70, 76, 78, 82, 86, 87, 88, 92, 93, 94, 96, 100, 101, 106, 112, 116, 117, 118, 120, 124, 126, 130, 134, 135, 136, 142, 144, 146, 147, 148, 154, 156, 160, 162, 166, 170, 171, 172, 176, 177
OFFSET
1,2
LINKS
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
Sequence in context: A175957 A307055 A060658 * A054028 A063716 A125212
KEYWORD
nonn
AUTHOR
Derek Orr, Mar 15 2014
STATUS
approved