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.

A221309 Numbers m such that no subset of {m-1, m, m+1} sums up to a prime number.

Original entry on oeis.org

25, 77, 85, 92, 93, 94, 118, 122, 123, 124, 133, 143, 144, 145, 160, 161, 170, 171, 185, 188, 202, 203, 206, 207, 208, 213, 214, 218, 235, 236, 237, 247, 248, 253, 259, 265, 266, 267, 275, 287, 290, 291, 295, 298, 302, 305, 319, 325, 328, 333, 334, 335, 340
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 10 2013

Keywords

Comments

A117499(a(n)) = 0.

Examples

			a(1) = 25: there are 7 nonempty subsets of {25-1, 25, 25+1}: {24}, {25}, {26}, {24,25}, {24,26}, {25,26} and {24,25,26} with sums and factorizations: 24=3*2^3, 25=5^2, 26=13*2, 49=7^2, 50=5^2*2, 51=17*3 and 75=5^2*3.
		

Crossrefs

Subsequence of A079364.

Programs

  • Haskell
    a221309 n = a221309_list !! (n-1)
    a221309_list = map (+ 1) $ elemIndices 0 a117499_list
  • Mathematica
    Flatten@Position[
      Plus @@ # & /@ (Rest@Subsets[# + {-1, 0, 1}]) & /@
    Range@340, {?(! PrimeQ@# &) ..}] (* _Hans Rudolf Widmer, Oct 26 2024 *)

A167705 Composite numbers having four composite nearest neighbors.

Original entry on oeis.org

26, 34, 50, 56, 64, 76, 86, 92, 93, 94, 116, 117, 118, 119, 120, 121, 122, 123, 124, 134, 142, 143, 144, 145, 146, 154, 160, 170, 176, 184, 185, 186, 187, 188, 202, 203, 204, 205, 206, 207, 208, 214, 215, 216, 217, 218, 219, 220, 236, 244, 245, 246, 247, 248, 254, 260, 266, 274, 286, 287, 288, 289, 290, 296, 297, 298, 299, 300
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 10 2009

Keywords

Comments

Almost all natural numbers are members of this sequence.

Examples

			a(1)=26 (24,25,27,28 are composite nearest neighbors), a(2)=34 (32,33,35,36 are composite nearest neighbors).
		

Crossrefs

Programs

Extensions

Comment and program from Charles R Greathouse IV, Nov 12 2009
Corrected terms, Clark Kimberling and Joerg Arndt, Jun 24 2011.

A210940 The prime numbers and their nonprime nearest-neighbors.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 22, 23, 24, 28, 29, 30, 31, 32, 36, 37, 38, 40, 41, 42, 43, 44, 46, 47, 48, 52, 53, 54, 58, 59, 60, 61, 62, 66, 67, 68, 70, 71, 72, 73, 74, 78, 79, 80, 82, 83, 84, 88, 89, 90, 96, 97, 98, 100
Offset: 1

Views

Author

Omar E. Pol, Apr 17 2012

Keywords

Comments

The prime numbers and their nearest-neighbors without repetitions.

Crossrefs

Union of A210939 and A000040. Complement of A079364.

Programs

  • Mathematica
    {#-1,#,#+1}&/@Prime[Range[30]]//Flatten//Union (* Harvey P. Dale, Jul 06 2019 *)

Extensions

Corrected (74 added) by Harvey P. Dale, Jul 06 2019

A160666 Numbers whose distance to the closest prime number is a prime number.

Original entry on oeis.org

0, 9, 15, 21, 25, 26, 27, 33, 34, 35, 39, 45, 49, 50, 51, 55, 56, 57, 63, 64, 65, 69, 75, 76, 77, 81, 85, 86, 87, 91, 92, 94, 95, 99, 105, 111, 115, 116, 118, 120, 122, 124, 125, 129, 133, 134, 135, 141, 142, 144, 146, 147, 153, 154, 155, 159, 160, 161, 165, 169, 170
Offset: 1

Views

Author

Kyle Stern, May 22 2009

Keywords

Comments

Terms n=2..31 are identical to terms n=1..30 of A079364.

Crossrefs

Programs

  • Maple
    isA160666 := proc(n) local ppl,pmi ; if isprime(n) then RETURN(false): elif n =0 then RETURN(true): elif n =1 then RETURN(false): fi; ppl := nextprime(n)-n ; pmi := n-prevprime(n) ; RETURN (isprime(min(ppl,pmi)) ) ; end: for n from 0 to 200 do if isA160666(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, May 25 2009
  • Mathematica
    fQ[n_] := PrimeQ[ Min[ NextPrime[n] - n, n - NextPrime[n, -1]]]; Select[ Range[0, 174], !PrimeQ@ # && fQ@# &] (* Robert G. Wilson v, May 25 2009 *)

Extensions

More terms from R. J. Mathar and Robert G. Wilson v, May 25 2009

A167776 Composite numbers having six composite nearest-neighbors.

Original entry on oeis.org

93, 117, 118, 119, 120, 121, 122, 123, 143, 144, 145, 185, 186, 187, 203, 204, 205, 206, 207, 215, 216, 217, 218, 219, 245, 246, 247, 287, 288, 289, 297, 298, 299, 300, 301, 302, 303, 321, 322, 323, 324, 325, 326, 327, 341, 342, 343, 363, 393, 405, 413, 414
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 11 2009

Keywords

Comments

Terms lie between primes separated by a gap of at least 8 (see A083371). - David A. Corneth, Jun 24 2016

Examples

			a(1)=117 (114,115,116,118,119,120 are composite nearest-neighbors);
a(2)=118 (115,116,117,119,120,121 are composite nearest-neighbors).
There are no primes between primes 241 and 251 which gives a gap of 10 between them. Therefore, all numbers between (inclusive) 241 + 4 and 251 - 4 are terms. - _David A. Corneth_, Jun 24 2016
		

Crossrefs

Programs

  • Mathematica
    Select[Range[6!],!PrimeQ[#] && !PrimeQ[#-1] && !PrimeQ[#+1] && !PrimeQ[#-2] && !PrimeQ[#+2] && !PrimeQ[#-3] && !PrimeQ[#+3]&] (* Vladimir Joseph Stephan Orlovsky, Dec 26 2010 *)
    Select[Range@ 414, Times @@ Boole@ Map[CompositeQ, Range[# - 3, # + 3]] == 1 &] (* Michael De Vlieger, Jun 24 2016 *)
  • PARI
    lista(n) = {forprime(i=2,n+3,g=nextprime(i+1)-i;
    for(j=i+4,i+g-4,print1(j", ")))}
    a(n) = {forprime(i=88,,g=nextprime(i+1)-i;n-=max(0,g-7);
    if(n<=0,return(i+g-4+n)))}
    \\ gives the next term larger than n, whether n is a term or not.
    nxt(n) = my(p=nextprime(n),g=0); if(p-n>4, n+1, while(1, q=nextprime(p+1); g=q-p; if(g>7, return(p+4), p=q))) \\ David A. Corneth, Jun 24 2016

Extensions

Corrected (93, 144, 145 inserted) by R. J. Mathar, May 30 2010

A168141 a(n) = pi(n + 1) - pi(n - 2), where pi is the prime counting function.

Original entry on oeis.org

1, 2, 2, 2, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 19 2009

Keywords

Comments

Conjecture: a(n) = 2 for infinitely many n. This is equivalent to the twin prime conjecture. - Andrew Slattery, Apr 26 2020

Crossrefs

Programs

  • Maple
    A168141 := proc(n) numtheory[pi](n+1)-numtheory[pi](n-2) ; end proc: seq(A168141(n),n=1..120) ; # R. J. Mathar, Nov 19 2009
    # second Maple program:
    a:= n-> add(`if`(isprime(n+i), 1, 0), i=-1..1):
    seq(a(n), n=1..120);  # Alois P. Heinz, Apr 28 2020
  • Mathematica
    Table[PrimePi[n + 1] - PrimePi[n - 2], {n, 100}] (* Wesley Ivan Hurt, Apr 26 2020 *)
  • PARI
    a(n) = primepi(n+1) - primepi(n-2); \\ Michel Marcus, Apr 27 2020

Formula

From Alois P. Heinz, Apr 28 2020: (Start)
a(n) = 2 <=> n in { 2,3 } union { A014574 }.
a(n) = 0 <=> n in A079364. (End)
Showing 1-6 of 6 results.