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-6 of 6 results.

A100318 Numbers n such that at least one of n-1 and n+1 is composite.

Original entry on oeis.org

3, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Comments

All odd numbers > 1 occur in this sequence. For the subsequence of even terms, see A100319.

Crossrefs

Cf. A100317 (exactly one of n-1 and n+1 is prime/composite), A100319.

Programs

  • Magma
    [n: n in [3..100] | not IsPrime(n-1) or not IsPrime(n+1) ]; // G. C. Greubel, Apr 25 2019
    
  • Mathematica
    Select[Range[3, 100], CompositeQ[#-1] || CompositeQ[#+1] &] (* G. C. Greubel, Apr 25 2019 *)
  • PARI
    for(n=3,100,if(isprime(n-1)+isprime(n+1)<=1,print1(n,",")))
    
  • Sage
    [n for n in (3..100) if (is_prime(n-1) + is_prime(n+1) <= 1)] # G. C. Greubel, Apr 24 2019

A168064 Numbers n such that exactly one of n+-1 and n+-2 is prime.

Original entry on oeis.org

0, 2, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 22, 24, 25, 27, 28, 29, 31, 32, 33, 35, 36, 38, 40, 41, 43, 44, 46, 48, 49, 51, 52, 54, 55, 57, 58, 59, 61, 62, 63, 65, 66, 68, 70, 71, 73, 74, 75, 77, 78, 80, 82, 84, 85, 87, 88, 90, 91, 95, 96, 98, 100, 101, 103, 104, 106, 107, 109
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 18 2009

Keywords

Examples

			a(1)=0 (-2,-1 and 1 are nonprime, 2 is prime); a(2)=2 (0,1 and 4 are nonprime, 3 is prime); a(3)=7 (6,8 and 9 are nonprime, 5 is prime); a(4)=10 (8,9 and 12 are nonprime, 11 is prime); a(5)=11 (9,10 and 12 are nonprime, 13 is prime).
		

Crossrefs

Programs

  • Mathematica
    Join[{0},Select[Range[120],Total[Boole[PrimeQ[#+{-2,-1,1,2}]]]==1&]] (* Harvey P. Dale, Apr 09 2020 *)
  • PARI
    is(n)=isprime(n-2)+isprime(n-1)+isprime(n+1)+isprime(n+2)==1 \\ Charles R Greathouse IV, Jun 13 2017

A168079 Numbers n such that exactly one of n+-1, n+-2 and n+-3 is prime.

Original entry on oeis.org

-1, 7, 11, 13, 17, 19, 24, 25, 27, 29, 31, 33, 35, 36, 41, 43, 48, 49, 51, 52, 54, 55, 57, 59, 61, 63, 65, 66, 71, 73, 75, 77, 78, 84, 85, 87, 88, 90, 91, 92, 94, 95, 96, 101, 103, 107, 109, 114, 115, 116, 124, 125, 126, 132, 133, 135, 137, 139, 141, 142, 146, 147, 149
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 18 2009

Keywords

Examples

			a(1)=-1 (-4,-3,-2,0 and 1 are nonprimes, 2 is prime);
a(2)=7 (4,6,8,9 and 10 are nonprimes, 5 is prime);
a(3)=13 (8,9,10,12 and 14 are nonprimes, 11 is prime).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length[Select[Drop[Range[n - 3, n + 3], {4}], PrimeQ]] == 1; Join[{-1}, Select[Range[0, 200], f]] (* G. C. Greubel, Jul 09 2016 *)
    Join[{-1},Select[Range[200],Total[Boole[PrimeQ[Drop[Range[#-3,#+3],{4}]]]]==1&]] (* Harvey P. Dale, Oct 16 2018 *)
  • PARI
    is(n)=isprime(n-3) + isprime(n-2) + isprime(n-1) + isprime(n+1) + isprime(n+2) + isprime(n+3) == 1 \\ Charles R Greathouse IV, Jun 13 2017

Formula

a(n) ~ 6n/log n. -Charles R Greathouse IV, May 25 2011

Extensions

Corrected (11, 57 inserted, 16 replaced by 126) by R. J. Mathar, Jun 04 2010

A168080 Numbers n such that exactly two of n+-1, n+-2 and n+-3 are primes.

Original entry on oeis.org

0, 1, 2, 3, 9, 12, 15, 18, 21, 22, 26, 28, 30, 32, 34, 38, 39, 42, 45, 46, 50, 56, 58, 60, 62, 64, 68, 69, 72, 74, 76, 80, 81, 82, 86, 98, 99, 102, 105, 108, 111, 112, 128, 129, 130, 134, 136, 138, 140, 148, 150, 152, 154, 160, 164, 165, 166, 170, 176, 178, 180, 182
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 18 2009

Keywords

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Length[Select[Drop[Range[n-3,n+3],{4}],PrimeQ]]==2; Join[{0,1}, Select[Range[0,200],okQ]] (* Harvey P. Dale, Jun 29 2011 *)

Extensions

Corrected (14 removed, 58, 62, 74 inserted, etc.) by R. J. Mathar, Jun 04 2010

A171689 Nonprimes n such that either n+-1 is prime.

Original entry on oeis.org

1, 8, 10, 14, 16, 20, 22, 24, 28, 32, 36, 38, 40, 44, 46, 48, 52, 54, 58, 62, 66, 68, 70, 74, 78, 80, 82, 84, 88, 90, 96, 98, 100, 104, 106, 110, 112, 114, 126, 128, 130, 132, 136, 140, 148, 152, 156, 158, 162, 164, 166, 168, 172, 174, 178, 182, 190, 194, 196, 200
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 15 2009

Keywords

Comments

Essentially the same as A100317.

Extensions

Comment from Charles R Greathouse IV, Mar 25 2010

A273088 a(n) is a multiple of 6 and a(n)-1 or a(n)+1 is an isolated (non-twin) prime number.

Original entry on oeis.org

24, 36, 48, 54, 66, 78, 84, 90, 96, 114, 126, 132, 156, 162, 168, 174, 210, 222, 234, 252, 258, 264, 276, 294, 306, 318, 330, 336, 354, 360, 366, 372, 378, 384, 390, 396, 402, 408, 438, 444, 450, 456, 468, 480, 486, 492, 498, 504, 510, 540, 546, 558, 564, 576, 588, 594
Offset: 1

Views

Author

Dimitris Valianatos, May 14 2016

Keywords

Examples

			66=6*11 and 66+1=67 are not twin primes, so 66 is a term.
		

Crossrefs

Intersection of A008588 and A100317.

Programs

  • Maple
    select(t -> isprime(t-1) <> isprime(t+1), 6*[$1..200]);  # Robert Israel, Jul 10 2023
  • Mathematica
    Select[6 Range@ 100, Total@ Boole@ Map[If[PrimeQ@ #, Count[Abs[# - {NextPrime[#, -1], NextPrime@ #}], k_ /; k == 2] < 1, False] &, {# - 1, # + 1}] > 0 &] (* Michael De Vlieger, May 15 2016 *)
  • PARI
    {
      forstep(n=6,1000,6,
        if((isprime(n-1)+isprime(n+1))==1,
          print1(n", ")
        )
      )
    }
Showing 1-6 of 6 results.