cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239321 Numbers n such that n - k! is never prime; or A175940(n) = 0.

This page as a plain text file.
%I A239321 #18 May 22 2025 10:21:37
%S A239321 1,2,10,16,22,28,34,36,40,46,50,51,52,56,57,58,64,66,70,76,78,82,86,
%T A239321 87,88,92,93,94,96,100,101,106,112,116,117,118,120,124,126,130,134,
%U A239321 135,136,142,144,146,147,148,154,156,160,162,166,170,171,172,176,177
%N A239321 Numbers n such that n - k! is never prime; or A175940(n) = 0.
%H A239321 Giovanni Resta, <a href="/A239321/b239321.txt">Table of n, a(n) for n = 1..10000</a>
%e A239321 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.
%o A239321 (Python)
%o A239321 import sympy
%o A239321 from sympy import isprime
%o A239321 import math
%o A239321 def Prf(x):
%o A239321   count = 0
%o A239321   for i in range(x):
%o A239321     if isprime(x-math.factorial(i)):
%o A239321       count += 1
%o A239321   return count
%o A239321 x = 1
%o A239321 while x < 10**3:
%o A239321   if Prf(x) == 0:
%o A239321     print(x)
%o A239321   x += 1
%o A239321 (PARI) isok(n) = {k = 0; while (((nmk =(n - k!)) > 0), if (isprime(nmk), return (0)); k++;); return (1);} \\ _Michel Marcus_, Mar 16 2014
%Y A239321 Cf. A175940, A125163.
%K A239321 nonn
%O A239321 1,2
%A A239321 _Derek Orr_, Mar 15 2014