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.

Previous Showing 11-19 of 19 results.

A144938 Squares k such that k - 2 and k + 2 are prime.

Original entry on oeis.org

9, 81, 225, 441, 1089, 13689, 56169, 74529, 91809, 95481, 149769, 184041, 194481, 199809, 263169, 314721, 328329, 370881, 651249, 804609, 1071225, 1147041, 1238769, 1306449, 1520289, 1535121, 1718721, 2442969, 2595321, 2614689
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n^2;If[PrimeQ[p-2]&&PrimeQ[p+2],AppendTo[lst,p]],{n,1,7!,2}];lst
  • PARI
    forstep(n=3,1e3,6,if(isprime(n^2-2)&&isprime(n^2+2),print1(n^2", "))) \\ Charles R Greathouse IV, Oct 05 2011

Formula

A087679 intersect A000290. - R. J. Mathar, Dec 11 2020

A284919 Even integers E such that there is no prime p < E with E - p and E + p both prime.

Original entry on oeis.org

0, 2, 4, 6, 28, 38, 52, 58, 62, 68, 74, 80, 82, 88, 94, 98, 112, 118, 122, 124, 128, 136, 146, 148, 152, 158, 164, 166, 172, 178, 182, 184, 188, 190, 206, 208, 212, 214, 218, 220, 224, 238, 242, 244, 248, 250, 256, 262, 268, 278, 284, 290, 292, 296, 298
Offset: 1

Views

Author

Claudio Meller, Apr 05 2017

Keywords

Comments

Or, even integers k such that k + p is composite for all primes p, q with p + q = k.
The two initial terms vacuously satisfy the definition, but all even numbers >= 4 are the sum of two primes, according to the Goldbach conjecture.
All odd numbers except for numbers m such that m-2 and m+2 are prime (= A087679) would satisfy the definition. - M. F. Hasler, Apr 05 2017
Conjecture: except for a(4)=6, all terms are coprime to 3. - Bob Selcoe, Apr 06 2017
If E is an even number not divisible by 3, then E is in the sequence unless E-3 and at least one of E+3 and 2E-3 are prime. - Robert Israel, Apr 10 2017
Consider a subsequence with the additional condition: n+odd part of p-1 is composite (for example, for p=19 it is 9). I found that this subsequence begins 0,2,118 and up to 300000 Peter J. C. Moses found only more one term 868. Is this subsequence finite? - Vladimir Shevelev, Apr 12 2017
One can compare the theoretical maxima with the actual sequence numbers of terms. Doing this at powers of 10, we see at powers {2,3,4,5,6} the ratio progression {2.33, 1.51, 1.25, 1.15, 1.096}. This implies that the excluded even numbers become increasingly rare (those coprime to 3). - Bill McEachen, Apr 17 2017
From Robert Israel's comment and the distribution of primes, the proportion of even numbers not divisible by 3 that are in the sequence tends to 1. - Peter Munn, Apr 23 2017
Moreover, If n is not divisible by 3 and 2*n - 3 is composite, then 2*n+p is also composite. Indeed, for these 2*n all primes p such that 2*n-p is prime are in the interval (3, 2*n-3). Then either 2*n-p or 2*n+p should be divisible by 3, but 2*n-p is a prime > 3. So 2*n+p is composite and 2*n is in the sequence. - Vladimir Shevelev, Apr 28 2017

Examples

			k=28 is in the sequence because 5+23 = 28 and 11+17 = 28, and 28 + {5,11,17,23} are composite; k=26 is not in the sequence because 3+23 = 26, 7+19 = 26 and 13+13 = 26, but 26+3 = 29 (prime).  - _Bob Selcoe_, Apr 06 2017
		

Crossrefs

Cf. A284928 (terms/2), A002375 (number of decompositions p + q = 2k), A020481 (least p: p + q = 2k), A277688 (an analog for decompositions odd k as 2p+q).

Programs

  • Mathematica
    fQ[n_] :=  Select[Select[Prime@Range@PrimePi@n, PrimeQ[n - #] &],    PrimeQ[n + #] &] == {}; Select[2 Range[0, 150], fQ] (* Robert G. Wilson v, Apr 05 2017 *)
  • PARI
    is(n)=!bittest(n,0)&&!forprime(p=2,n\2, isprime(n-p) && (isprime(n+p) || isprime(2*n-p)) && return) \\ Charles R Greathouse IV and M. F. Hasler, Apr 05 2017

Formula

a(n) = 2*A284928(n). - M. F. Hasler, Apr 06 2017

A029708 Numbers k such that k-2 and k+2 are consecutive primes.

Original entry on oeis.org

9, 15, 21, 39, 45, 69, 81, 99, 105, 111, 129, 165, 195, 225, 231, 279, 309, 315, 351, 381, 399, 441, 459, 465, 489, 501, 615, 645, 675, 741, 759, 771, 825, 855, 861, 879, 885, 909, 939, 969, 1011, 1089, 1095, 1215, 1281, 1299, 1305, 1425, 1431
Offset: 1

Views

Author

Keywords

Comments

All terms are multiples of 3. Minimal first difference is 6. - Zak Seidov, May 15 2013

Crossrefs

Essentially the same as A087679.

Programs

  • Magma
    [k:k in [1..1500]| IsPrime(k-2) and NextPrime(k-2) eq k+2 ]; // Marius A. Burtea, Jan 24 2019
  • Mathematica
    f[n_]:=PrimeQ[n-2]&&PrimeQ[n+2]; lst={};Do[If[f[n],AppendTo[lst,n]],{n,7,8!,2}];lst (* Vladimir Joseph Stephan Orlovsky, Oct 09 2009 *)
    Select[Range[9,1432,6],PrimeQ[#-2]&&PrimeQ[#+2]&] (* Zak Seidov, May 15 2013 - just for terms in DATA *)
    Mean/@Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&] (* Harvey P. Dale, Feb 15 2020 *)

Formula

a(n) = (A029710(n) + A031505(n+1))/2 = A029710(n) + 2 = A031505(n+1) - 2.

A168063 Numbers k such that exactly two of {k-2, k-1, k+1, k+2} are primes.

Original entry on oeis.org

1, 3, 5, 6, 9, 12, 15, 18, 21, 30, 39, 42, 45, 60, 69, 72, 81, 99, 102, 105, 108, 111, 129, 138, 150, 165, 180, 192, 195, 198, 225, 228, 231, 240, 270, 279, 282, 309, 312, 315, 348, 351, 381, 399, 420, 432, 441, 459, 462, 465, 489, 501, 522, 570, 600, 615, 618
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 18 2009

Keywords

Comments

Essentially the same as A014574 U A087679. - Charles R Greathouse IV, May 25 2011

Crossrefs

Programs

Extensions

Corrected (105 inserted, 609 removed) by R. J. Mathar, Jun 04 2010

A189051 Numbers n such that n+/-2 and n^2+/-2 are all primes.

Original entry on oeis.org

9, 15, 21, 309, 441, 1611, 2955, 3081, 3879, 5529, 7209, 7755, 7875, 13761, 15015, 15729, 16659, 21561, 22155, 35595, 37059, 38199, 45291, 50049, 51429, 59619, 63855, 67215, 67941, 71331, 72891, 83061, 96459, 96909, 102795, 106959, 111495
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 16 2011

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..2000000]|IsPrime(n-2)and IsPrime(n+2)and IsPrime(n^2-2)and IsPrime(n^2+2)]; // Vincenzo Librandi, Apr 20 2011
  • Maple
    select(n -> isprime(n-2) and isprime(n+2) and isprime(n^2-2) and isprime(n^2+2),
    [seq(i,i=3..10^6, 6)]); # Robert Israel, Jun 23 2017
  • Mathematica
    pQ[n_]:=Module[{n2=n^2},And@@PrimeQ[{n+2,n-2,n2+2,n2-2}]]; Select[Range[ 120000],pQ] (* Harvey P. Dale, Jun 04 2011 *)
  • PARI
    forstep(n=3,100000,6,if(isprime(n-2)&isprime(n+2)&isprime(n^2-2)&isprime(n^2+2),print1(n", ")))
    

Formula

Intersection of A087679 and A108701.

Extensions

Corrected and extended by Franklin T. Adams-Watters, Apr 16 2011

A329727 Numbers k such that k^3 +- 2 and k +- 2 are prime.

Original entry on oeis.org

129, 1491, 1875, 2709, 5655, 6969, 10335, 14325, 14421, 17319, 26559, 35109, 37509, 43719, 50229, 52629, 101871, 102795, 104325, 105501, 120429, 127599, 132699, 136395, 137829, 157521, 172425, 173685, 179481, 186189, 191829, 211371, 219681, 221199, 229215, 234195
Offset: 1

Views

Author

K. D. Bajpai, Nov 19 2019

Keywords

Comments

All terms in this sequence are divisible by 3.

Examples

			a(1) = 129:
  129^3 + 2 = 2146691;
  129^3 - 2 = 2146687;
  129   + 2 =     131;
  129   - 2 =     127; all four results are prime.
a(2) = 1491:
  1491^3 + 2 = 3314613773;
  1491^3 - 2 = 3314613769;
  1491   + 2 =       1493;
  1491   - 2 =       1489; all four results are prime.
		

Crossrefs

Intersection of A038599, A067200, and A087679.

Programs

  • Magma
    [k:k in [1..250000]|forall{m:m in [-2,2]|IsPrime(k+m) and IsPrime(k^3+m)}]; // Marius A. Burtea, Nov 20 2019
    
  • Mathematica
    Select[Range[500000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[# + 2] && PrimeQ[# - 2] &]
  • PARI
    isok(k) = isprime(k-2) && isprime(k+2) && isprime(k^3-2) && isprime(k^3+2); \\ Michel Marcus, Nov 24 2019
    
  • PARI
    list(lim)=my(v=List(),p=127,k); forprime(q=131,lim+2,if(q-p==4 && isprime((k=p+2)^3-2) && isprime(k^3+2), listput(v,k)); p=q); Vec(v) \\ Charles R Greathouse IV, May 06 2020

A164130 Sums s of squares of three consecutive primes, such that s-+2 are primes.

Original entry on oeis.org

195, 5739, 18459, 32259, 33939, 60291, 74019, 169491, 187131, 244899, 276819, 388179, 783531, 902139, 3588339, 5041491, 5145819, 5193051, 8687091, 9637491, 10227291, 10910019, 11341491, 11757339, 14834379, 15354651, 16115091
Offset: 1

Views

Author

Keywords

Examples

			5^2 + 7^2 + 11^2 = 195 is a sum of the squared consecutive primes 5, 7 and 11, and 193 and 197 are primes, so 195 is a member of the sequence.
		

Crossrefs

Programs

  • Maple
    q:= 2: r:= 3: R:= NULL: count:= 0:
    while count < 100 do
      p:= q; q:= r; r:= nextprime(r);
      s:= p^2+q^2+r^2;
      if isprime(s-2) and isprime(s+2) then
        count:= count+1; R:= R,s;
      fi;
    od:
    R; # Robert Israel, Apr 21 2023
  • Mathematica
    lst={};Do[p=Prime[n]^2+Prime[n+1]^2+Prime[n+2]^2;If[PrimeQ[p-2]&&PrimeQ[p+2], AppendTo[lst,p]],{n,8!}];lst

Formula

A133529 INTERSECT A087679. - R. J. Mathar, Aug 27 2009

Extensions

Comment turned into example by R. J. Mathar, Aug 27 2009

A172483 a(n) is the number of cousin primes between p^2 and p*(p+4) where p is the n-th cousin prime A023200(n).

Original entry on oeis.org

2, 1, 1, 2, 5, 4, 4, 2, 6, 4, 7, 7, 5, 9, 12, 13, 14, 14, 9, 12, 10, 11, 13, 20, 16, 15, 16, 15, 23, 19, 22, 26, 27, 28, 26, 22, 20, 27, 25, 27, 28, 26, 35, 29, 29, 29, 30, 45, 30, 36, 22, 30, 39, 39, 40, 44, 44, 43, 34, 38, 36, 48, 54, 43, 38, 43, 49, 45, 47, 53, 38, 51, 51, 62, 56
Offset: 1

Views

Author

Jaspal Singh Cheema, Feb 04 2010

Keywords

Comments

If you graph the order of the consecutive cousin primes along the x-axis (i.e., first pair of cousin primes, second, third,...) and the number of cousin primes in the sequence given above along the y-axis, a clear pattern emerges. As you go farther along the x-axis, greater are the number of consecutive cousin primes, on average, within the interval obtained. If one can prove that there's at least one consecutive cousin prime within each interval, this would imply that cousin primes are infinite. I suspect the number of consecutive primes within each interval will never be zero. Can you prove it?

Examples

			The 1st pair of cousin primes is (3, 7), between 3^2=9 and 3*7=21 there is 2 cousin primes: 13 and 19. So a(1) = 2.
The 2nd pair of cousin primes is (7, 11), between 7^2=49 and 7*11=77 there is 1 cousin prime: 67. So a(2) = 1.
		

References

  • C. C. Clawson, Mathematical Mysteries: The Beauty and Magic of Numbers, Perseus Books, 1999.
  • M. D. Sautoy, The Music of the Primes: Searching to Solve the Greatest Mystery in Mathematics, HarperCollins Publishers Inc., 2004.

Crossrefs

Programs

  • PARI
    vcp(nn) = my(list=List(), p=3); listput(list, p); p=7; forprime(q=11, nn, if(q-p==4, listput(list, p)); p=q); Vec(list); \\ A023200
    nbcp(p) = my(nb=0); forprime(q=p^2, p*(p+4), if (isprime(q+4), nb++)); nb;
    lista(nn) = my(v=vcp(nn)); vector(#v, n, nbcp(v[n])); \\ Michel Marcus, Nov 02 2022

Extensions

New name and a(1)=2 prepended by Michel Marcus, Nov 02 2022

A293271 Numbers n such that n - p and n + p are both prime for some prime p.

Original entry on oeis.org

5, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 30, 32, 34, 36, 39, 40, 42, 44, 45, 46, 48, 50, 54, 56, 60, 64, 66, 69, 70, 72, 76, 78, 81, 84, 86, 90, 92, 96, 99, 100, 102, 104, 105, 106, 108, 110, 111, 114, 116, 120, 126, 129, 130, 132, 134, 138, 140, 142
Offset: 1

Views

Author

Gionata Neri, Oct 04 2017

Keywords

Comments

Apart from a(1), all terms are composite.
Union of A087679 and 2*A063713. - Robert Israel, Oct 09 2017

Crossrefs

Cf. A087679, A087695, A087696, A087697 (subsequences).
Cf. A063713.

Programs

  • Maple
    filter:= proc(n) local k;
      k:= 1;
      while k < n do
        k:= nextprime(k);
        if isprime(n+k) and isprime(n-k) then return true fi
      od;
      false
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Oct 09 2017
  • Mathematica
    Select[Range@ 142, Function[n, AnyTrue[Prime@ Range@ PrimePi@ n, PrimeQ[n + {-#, #}] == {True, True} &]]] (* Michael De Vlieger, Oct 09 2017 *)
  • PARI
    a(n) = forprime(p=1, n, i=n-p; j=n+p; if(isprime(i)&&isprime(j), n; break))
Previous Showing 11-19 of 19 results.