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

A178228 Numbers k such that (k^3 - 2, k^3 + 2) is a pair of cousin primes (see A178227).

Original entry on oeis.org

129, 189, 369, 435, 549, 555, 561, 819, 1245, 1491, 1719, 1779, 1839, 1875, 1935, 2175, 2289, 2415, 2451, 2595, 2709, 2769, 3141, 3441, 4401, 4611, 4851, 5655, 5775, 6075, 6099, 6795, 6969, 7125, 7239, 7365, 8109, 8139, 8325, 8361, 8385, 8535, 8685, 9591, 9765
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), May 23 2010

Keywords

Comments

Necessarily k is an odd multiple of 3, Least significant digit of k is e = 1, 5 or 9 (3^3 - 2, 7^3 + 2 are multiples of 5).

Examples

			189 is a term since 189^3 - 2 = 6751267 = prime(460792), 189^3 + 2 = 6751271 = prime(460793).
12471 is a term since 12471^3 - 2 = 1939562763109 = prime(i), i = 71166976775, 12471^3 + 2 = 1939562763113 = prime(i+1).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^4], And @@ PrimeQ[#^3 + {-2, 2}] &] (* Amiram Eldar, Dec 24 2019 *)
  • PARI
    for(n=1,10000,my(p1=n^3-2,p2=n^3+2);if(isprime(p1)&&isprime(p2)&&ispower((p1+p2)/2,3),print1(n,", "))) \\ Hugo Pfoertner, Dec 24 2019

Extensions

Edited by N. J. A. Sloane, May 23 2010
a(1) and a(21) inserted by Amiram Eldar, Dec 24 2019

A090125 a(n) is the least positive integer such that nextprime(a(n)^n) - prevprime(a(n)^n) = 4.

Original entry on oeis.org

5, 3, 2, 2, 411, 195, 2, 392, 141, 105, 1161, 909, 69, 3243, 171, 370, 1659, 165, 26289, 1065, 8541, 19593, 43521, 1323, 84651, 25767, 25641, 7029, 63009, 693, 231, 957, 2601, 7137, 368265, 14769, 8169, 13071, 23679, 45, 13875, 6693, 136611, 34869, 55725, 4887, 231, 1935, 730071, 10305
Offset: 1

Views

Author

Labos Elemer, Jan 12 2004

Keywords

Examples

			with q-p=4,q,p are primes:
n=1:a(1)=5 because {p=3,a(1)^1=5,q=5};
n=7:a(7)=2 because {p=127,a(7)^7=128, q=131};
n=10:a(10)=105 because {p=c-2,c=a(10)^10=162889462677744140625,q=c+2}
		

Crossrefs

Programs

  • Mathematica
    Table[fla=1;Do[If[((PrimeQ[s=n^k-3]&&PrimeQ[s1=n^k+1]) ||(PrimeQ[s=n^k-2]&&PrimeQ[s1=n^k+2])||(PrimeQ[s=n^k-1] &&PrimeQ[s1=n^k+3]))&&Equal[fla, 1]&&!Equal[n, 1], Print[{n, p, n^k, q, {k}}];fla=0], {n, 1, 1000000}], {k, 1, 60}]
  • PARI
    a(n) = {my(k=1); while (nextprime(k^n+1) - precprime(k^n-1) != 4, k++); k;} \\ Michel Marcus, Sep 03 2019
    
  • PARI
    f(k,r) = ispseudoprime(k-r) && ispseudoprime(k-r+4);
    a(n) = for(k=1, oo, my(t=k^n); if((f(t,1) || f(t,2) || f(t,3)) && nextprime(t+1)-precprime(t-1)==4, return(k))); \\ Daniel Suteu, Sep 03 2019

Extensions

a(2) corrected and a(45)-a(50) from Daniel Suteu, Sep 03 2019

A090123 Integers k such that nextprime(k^5) - prevprime(k^5) = 4.

Original entry on oeis.org

411, 741, 819, 4041, 6165, 6315, 6861, 10281, 11025, 12489, 12579, 13119, 14331, 15225, 16095, 19125, 19881, 19929, 20799, 22461, 24051, 24885, 25815, 25971, 26979, 27075, 29955, 30801, 31641, 32661, 37371, 38361, 39369, 41181, 42681
Offset: 1

Views

Author

Labos Elemer, Jan 12 2004

Keywords

Examples

			For k = 411, k^5 = 11727599043051; nextprime(k^5) - prevprime(k^5) = 11727599043053 - 11727599043049 = 4, so k is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    pre[x_] := Prime[PrimePi[x]]; nex[x_] := Prime[PrimePi[x]+1]; de[x_] := Prime[PrimePi[x]+1]-Prime[PrimePi[x]]; k=5; Do[If[Equal[Prime[PrimePi[n^k]+1]-Prime[PrimePi[n^k]], 4], Print[n]], {n, 2, 100000}]
    np4Q[n_]:=Module[{c=n^5},NextPrime[c]-NextPrime[c,-1]==4]; Select[ Range[ 43000], np4Q] (* Harvey P. Dale, Oct 06 2017 *)
  • PARI
    isok(n) = (nextprime(n^5+1) - precprime(n^5-1)) == 4; \\ Michel Marcus, May 25 2018

Extensions

Wrong term 1 removed by Michel Marcus, May 25 2018

A090124 a(n) is the least positive n-th power integer such that nextprime[a(n)]-prevprime[a(n)]=q-p-4;.

Original entry on oeis.org

5, 4, 8, 16, 11727599043051, 54980371265625, 128, 557556054479199010816, 22027845102081762861, 162889462677744140625, 803596764671634487466709, 14231716419191575233132742871310396257144854491849
Offset: 1

Views

Author

Labos Elemer, Jan 12 2004

Keywords

Examples

			n=4:a(n)=16,{p=13,16=4^4,q=17}
		

Crossrefs

Programs

  • Mathematica
    Table[fla=1;Do[If[((PrimeQ[s=n^k-3]&&PrimeQ[s1=n^k+1]) ||(PrimeQ[s=n^k-2]&&PrimeQ[s1=n^k+2])||(PrimeQ[s=n^k-1] &&PrimeQ[s1=n^k+3]))&&Equal[fla, 1]&&!Equal[n, 1], Print[n^k];fla=0], {n, 1, 1000000}], {k, 1, 60}]

A176684 Numbers k such that k^3 +-5 are primes.

Original entry on oeis.org

2, 12, 48, 66, 78, 126, 192, 324, 576, 738, 858, 1806, 2466, 2496, 2688, 3186, 3276, 3978, 4092, 4248, 4404, 4884, 5034, 5274, 5352, 5898, 6018, 6198, 6396, 6408, 6516, 6708, 6852, 7368, 7914, 8304, 8628, 8658, 8904, 9048, 9168, 9528, 10812, 10932
Offset: 1

Views

Author

Keywords

Examples

			12 is in the sequence, because 12^3 - 5 = 1723 and 12^3 + 5 = 1733 are primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[8! ],PrimeQ[ #^3-5]&&PrimeQ[ #^3+5]&]

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

A176685 Numbers k such that k^3 +-7 are primes.

Original entry on oeis.org

36, 114, 174, 264, 426, 444, 810, 894, 900, 2724, 3876, 4140, 4386, 4446, 4686, 4884, 5910, 5940, 6240, 6294, 6534, 6624, 7044, 7206, 7314, 7326, 7470, 8076, 8676, 9120, 9216, 9270, 9546, 9900, 10926, 11040, 11934, 12114, 12510, 14004, 14034, 14100
Offset: 1

Views

Author

Keywords

Examples

			36 is in the sequence, because 36^3 - 7 = 46649 and 36^3 + 7 = 46663 are primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[8! ],PrimeQ[ #^3-7]&&PrimeQ[ #^3+7]&]
    Select[Range[15000],AllTrue[#^3+{7,-7},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 28 2020 *)

A268475 Numbers n such that n^3 +/- 2 and 3*n +/- 2 are all prime.

Original entry on oeis.org

435, 555, 2415, 31635, 38025, 44835, 80625, 88335, 97455, 98505, 99435, 124335, 142065, 145095, 165375, 176055, 204765, 246435, 279225, 293475, 310095, 315555, 332085, 344745, 348735, 376935, 392415, 443595, 462105, 467385, 482355, 581415, 609555, 626775, 636015
Offset: 1

Views

Author

K. D. Bajpai, Feb 05 2016

Keywords

Comments

All the terms in this sequence are congruent to 0 (mod 5).
Each term in this sequence yields two sets of cousin prime pairs i.e., for n = 435 -> {82312877, 82312873} and {1307, 1303}.
All terms are congruent to 15 mod 30. - Robert Israel, Feb 05 2016

Examples

			435 is in the sequence because 435^3 + - 2 =  82312877, 82312873; 3*435 + - 2 = 1307, 1303 are all prime.
555 is in the sequence because 555^3 + - 2 =  170953877, 170953873; 3*555 + - 2 = 1667, 1663 are all prime.
		

Crossrefs

Programs

  • Magma
    [n : n in [1..1e5] | IsPrime(n^3 + 2) and IsPrime(n^3 - 2) and IsPrime(3*n + 2) and IsPrime(3*n - 2)];
  • Maple
    select(n -> andmap(isprime, [n^3 + 2, n^3 - 2, 3*n + 2, 3*n - 2]), [seq(p, p=1.. 10^6)]);
  • Mathematica
    Select[Range[1000000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[3 # + 2] && PrimeQ[3 # - 2] &]
  • PARI
    for(n = 1,1e5, if( isprime(n^3 + 2) && isprime(n^3 - 2) && isprime(3*n + 2) && isprime(3*n - 2), print1(n ", ")))
    
Showing 1-8 of 8 results.