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.

Original entry on oeis.org

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

Views

Author

Derek Orr, Mar 15 2014

Keywords

Examples

			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.
		

Crossrefs

Programs

  • PARI
    isok(n) = {k = 0; while (((nmk =(n - k!)) > 0), if (isprime(nmk), return (0)); k++;); return (1);} \\ Michel Marcus, Mar 16 2014
  • 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