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-2 of 2 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

A167692 The even nonisolated nonprimes.

Original entry on oeis.org

0, 8, 10, 14, 16, 20, 22, 24, 26, 28, 32, 34, 36, 38, 40, 44, 46, 48, 50, 52, 54, 56, 58, 62, 64, 66, 68, 70, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 104, 106, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 140, 142, 144, 146, 148
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 09 2009

Keywords

Comments

Zero together with A100319, the even numbers n such that at least one of n-1 and n+1 is composite.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 100], Mod[#, 2] == 0 && !PrimeQ[#] && (! PrimeQ[# - 1] || !PrimeQ[# + 1]) &] (* G. C. Greubel, Jul 07 2016 *)
    Join[{0},Select[Range[2,150,2],AnyTrue[#+{1,-1},CompositeQ]&]] (* Harvey P. Dale, Nov 10 2024 *)
  • PARI
    isA167692(n) = (n%2==0)&&!isprime(n)&&(!isprime(n-1)||!isprime(n+1)) \\ Michael B. Porter, Feb 02 2010

Extensions

Edited by Charles R Greathouse IV, Mar 22 2010
Showing 1-2 of 2 results.