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.

Showing 1-7 of 7 results.

A125162 a(n) is the number of primes of the form k! + n, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 4, 0, 1, 1, 5, 1, 3, 0, 1, 1, 6, 1, 7, 0, 1, 1, 6, 0, 1, 0, 1, 1, 6, 1, 9, 0, 0, 0, 3, 1, 11, 0, 1, 1, 9, 1, 5, 0, 1, 1, 10, 0, 2, 0, 1, 1, 9, 0, 2, 0, 1, 1, 10, 1, 9, 0, 0, 0, 3, 1, 9, 0, 1, 1, 8, 1, 9, 0, 0, 0, 5, 1, 9, 0, 1, 1, 11, 0, 1, 0, 1, 1, 8, 0, 3, 0, 0, 0, 2, 1, 10, 0, 1, 1, 10, 1
Offset: 1

Views

Author

Alexander Adamchuk, Nov 21 2006

Keywords

Comments

Note the triples of consecutive zeros in a(n) for n = {{32,33,34}, {62,63,64}, {74,75,76}, {92,93,94}, {116,117,118}, {122,123,124}, {140,141,142}, {152,153,154}, {158,159,160}, {182,183,184}, {200,201,202}, {206,207,208}, {212,213,214}, {218,219,220}, {242,243,244}, {272,273,274}, {284,285,286}, ...}. The middle index of most zero triples is a multiple of 3. See A125164.
The first consecutive quintuple of zeros has indices n = {294,295,296,297,298}, where the odd zero index n = 295 is not a multiple of 3.
Also for n >= 2, a(n) is the number of primes of the form k! + n for all k, since n divides k! + n for k >= n. Note that it is not known whether there are infinitely many primes of the form k! + 1; see A088332 for such primes and A002981 for the indices k. - Jianing Song, Jul 28 2018

Examples

			a(n) is the length of n-th row in the table of numbers k such that k! + n is a prime, 1 <= k <= n.
   n:  numbers k
   -------------
   1:  {1},
   2:  {1},
   3:  {2},
   4:  {1},
   5:  {2, 3, 4},
Thus a(1)-a(4) = 1, a(5) = 3.
See Example table link for more rows.
		

Crossrefs

Cf. A125163 (indices of 0), A125164 (triples).

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeQ[ #!+n]&]],{n,1,300}]
  • PARI
    a(n)=c=0;for(k=1,n,if(ispseudoprime(k!+n),c++));c
    vector(100,n,a(n)) \\ Derek Orr, Oct 15 2014

Extensions

Name clarified by Jianing Song, Jul 28 2018
Edited by Michel Marcus, Jul 29 2018

A125164 Positive integers n such that no prime exists of the form (k! + 3n - 1), (k! + 3n) or (k! + 3n + 1) for any k.

Original entry on oeis.org

11, 21, 25, 31, 39, 41, 47, 51, 53, 61, 67, 69, 71, 73, 81, 91, 95, 99, 101, 107, 109, 111, 113, 121, 123, 125, 131, 135, 137, 141, 145, 151, 157, 161, 165, 171, 175, 177, 179, 181, 183, 191, 193, 201, 203, 207, 209, 211, 221, 223, 229, 231, 235, 237, 241, 243, 245, 249, 251, 255, 259
Offset: 1

Views

Author

Alexander Adamchuk, Nov 22 2006

Keywords

Comments

3*a(n) is an index of the middle term in a triple of consecutive zeros in A125162. The indices of zeros in A125162 are listed in A125163.
Primes in this sequence form A115058.

Examples

			Triplets of consecutive terms in A125163: {32,33,34}, {62,63,64}, {74,75,76}, {92,93,94}, {116,117,118}, {122,123,124}, {140,141,142}, {152,153,154}, {158,159,160}, {182,183,184}, {200,201,202}, {206,207,208}, {212,213,214}, {218,219,220}, {242,243,244}, {272,273,274}, {284,285,286}.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2,300],NoneTrue[Flatten[Table[k!+3*#+{-1,0,1},{k,#-1}]],PrimeQ]&] (* Harvey P. Dale, Jun 24 2025 *)

Extensions

Edited and extended by Max Alekseyev, Feb 06 2010

A125211 a(n) = total number of primes of the form |k! - n|.

Original entry on oeis.org

0, 0, 2, 3, 2, 1, 3, 2, 2, 0, 5, 1, 7, 1, 1, 0, 9, 1, 6, 1, 2, 1, 4, 1, 2, 1, 1, 0, 5, 1, 8, 1, 1, 0, 2, 0, 10, 1, 1, 0, 6, 1, 10, 1, 1, 0, 10, 1, 3, 0, 0, 0, 7, 1, 2, 0, 0, 0, 7, 1, 11, 1, 1, 0, 2, 0, 9, 1, 1, 0, 9, 1, 11, 1, 1, 0, 4, 0, 11, 1, 1, 0, 8, 1, 3, 0, 0, 0, 14, 1, 3, 0, 0, 0, 2, 0, 11, 1, 1, 0, 9
Offset: 1

Views

Author

Alexander Adamchuk, Nov 23 2006

Keywords

Comments

Numbers n such that a(n) = 0 are listed in A125212(n) = {1,2,10,16,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,...} Numbers n such that no prime exists of the form k! - n. Note the triples of consecutive zeros in a(n) for n = {{50,51,52}, {56,57,58}, {86,87,88}, {92,93,94}, ...}. Most zeros in a(n) have even indices. The middle index of most consecutive zero triples is odd and is a multiple of 3. Numbers n such that no prime exists of the form (k! - 3n - 1), (k! - 3n), (k! - 3n + 1) are listed in A125213(n) = {17,19,29,31,45,49,57,59,63,69,73,79,83,85,87,89,97,99,...}. The first pair of odd middle indices of zero triples that are not divisible by 3 is n = 325 and n = 329. They belong to the first septuplet of consecutive zeros in a(n): a(324)-a(330) = 0.

Examples

			a(4) = 3 because there are 3 primes of the form |k! - 4|:
1! - 4 = -3, 2! - 4 = -2, 3! - 4 = 2.
k! - 4 is composite for all k>3 because it is divisible by 4.
		

Crossrefs

Cf. A125162 = number of primes of the form k! + n. Cf. A125163 = numbers n such that no prime exists of the form k! + n. Cf. A125164 = numbers n such that no prime exists of the form (k! + 3n - 1), (k! + 3n), (k! + 3n + 1). Cf. A125212, A125213.

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeQ[ #!-n]&]],{n,1,300}]

A125212 Numbers m such that no prime exists of the form |k! - m|; or A125211(m) = 0.

Original entry on oeis.org

1, 2, 10, 16, 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, 106, 112, 116, 120, 124, 126, 130, 134, 135, 136, 142, 144, 146, 147, 148, 154, 156, 160, 162, 166, 170, 171, 172, 176, 177, 178, 184, 186, 188, 189
Offset: 1

Views

Author

Alexander Adamchuk, Nov 23 2006

Keywords

Comments

Note the triples of consecutive zeros in A125211 for n = {{50,51,52}, {56,57,58}, {86,87,88}, {92,93,94}, ...}. Most zeros in A125211 have even indices. The middle index of most consecutive zero triples in A125211 is odd and is a multiple of 3. Numbers n such that no prime exists of the form (k! - 3n - 1), (k! - 3n), (k! - 3n + 1) are listed in A125213. The first pair of odd middle indices of zero triples that are not divisible by 3 is n = 325 and n = 329. They belong to the first septuplet of consecutive zeros in A125211. A125211(n) = 0 for 7 consecutive terms from n = 324 to n = 330.

Examples

			A125211 begins {0,0,2,3,2,1,3,2,2,0,5,1,7,1,1,0,9,1,6,1,2,1,4,1,2,1,1,0,5,1,8,1,1,0,2,0,10,1,1,0,6,1,10,1,1,0,10,1,3,0,0,0,7,...}.
Thus a(1) = 1, a(2) = 2, a(3) = 10, a(10)-a(12) = {50,51,52}.
		

Crossrefs

Cf. A125162 (number of primes of the form k! + n).
Cf. A125163 (numbers n such that no prime exists of the form k! + n).
Cf. A125164 (numbers n such that no prime exists of the form (k! + 3n - 1), (k! + 3n), (k! + 3n + 1)).

Programs

  • Mathematica
    k={};Do[If[Length[Select[Range[m],PrimeQ[#!-m]&]]==0,AppendTo[k,m]],{m,189}];k (* James C. McMahon, Dec 16 2024 *)
  • PARI
    isok(m)={for(k=1, m-1, if(isprime(abs(k!-m)), return(0))); 1} \\ Andrew Howroyd, Dec 16 2024

A125213 Integers m such that no prime exists of the form abs(k! - 3m - 1), abs(k! - 3m), or abs(k! - 3m + 1).

Original entry on oeis.org

17, 19, 29, 31, 45, 49, 57, 59, 63, 69, 73, 79, 83, 85, 87, 89, 97, 99, 101, 107, 109, 115, 119, 121, 129, 131, 135, 139, 143, 149, 151, 157, 159, 161, 165, 169, 171, 173, 177, 179, 185, 187, 189, 195, 197, 199, 209, 213, 217, 219, 223, 227, 229, 233, 235, 249, 255, 259
Offset: 1

Views

Author

Alexander Adamchuk, Nov 23 2006

Keywords

Comments

3*a(n) are the indices of the middle terms in the triples of consecutive zeros in A125211. The middle index of most consecutive zero triples in A125211 is odd and is a multiple of 3.

Examples

			Triplets of consecutive zeros in A125211: {50,51,52}, {56,57,58}, {86,87,88}, {92,93,94}, ...
		

Crossrefs

Extensions

Edited and extended by Max Alekseyev, Feb 10 2010

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
    

A242040 Numbers n such that n + k! and n - k! are both prime for some k.

Original entry on oeis.org

4, 5, 6, 9, 11, 12, 13, 15, 17, 18, 21, 23, 25, 29, 30, 35, 37, 39, 42, 43, 45, 47, 53, 55, 60, 65, 67, 69, 72, 73, 77, 81, 83, 85, 95, 99, 102, 103, 105, 107, 108, 111, 113, 125, 127, 129, 131, 133, 137, 138, 143, 145, 149, 150, 151, 155, 157, 161, 163, 165, 173, 175, 180, 185, 187
Offset: 1

Views

Author

Derek Orr, Aug 12 2014

Keywords

Comments

Subsequence of the complement of (A239321 union A125163).

Examples

			5 + 2! = 7 and 5 - 2! = 3 are both prime. Thus 5 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,n,if(ispseudoprime(n+k!)&&ispseudoprime(n-k!),return(k)))
    n=1;while(n<500,if(a(n),print1(n,", "));n++)
Showing 1-7 of 7 results.