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-10 of 12 results. Next

A088485 Numbers n such that n^2 + n - 1 and n^2 + n + 1 are twin primes.

Original entry on oeis.org

2, 3, 5, 6, 8, 15, 20, 21, 24, 38, 41, 50, 54, 59, 66, 89, 101, 131, 138, 141, 153, 155, 164, 176, 188, 203, 206, 209, 215, 218, 231, 236, 246, 288, 290, 309, 314, 351, 378, 395, 405, 453, 455, 456, 495, 500, 518, 530, 551, 560, 624, 644, 668, 686, 720, 728, 743, 761, 798, 825, 890, 915, 950, 974, 981
Offset: 1

Views

Author

Pierre CAMI, Nov 09 2003

Keywords

Comments

A265006 gives these primes. - Derek Orr, Dec 24 2015

Examples

			20*20 + 20 - 1 = 419, 419 and 421 twin primes, 20 is the 7th of the sequence
		

Crossrefs

Programs

  • Magma
    [n: n in [1..2*10^3] |IsPrime(n^2+n-1) and IsPrime(n^2+n+1)]; // Vincenzo Librandi, Dec 26 2015
  • Mathematica
    Select[Range[500], PrimeQ[ #^2+#-1] && PrimeQ[ #^2+#+1] &] (* T. D. Noe, Jun 22 2004 *)
    Select[Range[1000],AllTrue[#^2+#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 12 2017 *)
  • PARI
    for(n=1,10^3,if(isprime(n^2+n-1)&&isprime(n^2+n+1),print1(n,", "))) \\ Derek Orr, Dec 24 2015
    

Extensions

Corrected description from T. D. Noe, Jun 22 2004

A120364 Primes p such that p^2-p-1 and p^2-p+1 are twin primes.

Original entry on oeis.org

3, 7, 67, 139, 379, 457, 1201, 1381, 1549, 1567, 1747, 1789, 2137, 2557, 2647, 2731, 4057, 4159, 4447, 4561, 5179, 5641, 6397, 9157, 9661, 9829, 9967, 10369, 11467, 11677, 12487, 12781, 13339, 13399, 15241, 17299, 17977, 19207, 19417, 19429
Offset: 1

Views

Author

Pierre CAMI, Jun 26 2006

Keywords

Comments

One more than the entries of (A006093 intersect A088485). - Danny Rorabaugh, May 15 2017

Examples

			3*3-3-1=5 3*3-3+1=7, 5 and 7 twin primes so a(1)=3;
5*5-5-1=19 5*5-5+1=21 composite;
7*7-7-1=41 7*7-7+1=43, 41 and 43 twin primes so a(2)=7.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2500]], PrimeQ[ #^2 - # - 1] && PrimeQ[ #^2 - # + 1] &] (* Stefan Steinerberger, Jul 22 2006 *)
    Select[Prime[Range[2500]],AllTrue[#^2-#+{1,-1},PrimeQ]&] (* Harvey P. Dale, Jul 25 2021 *)

Extensions

More terms from Stefan Steinerberger and Rick L. Shepherd, Jul 22 2006

A228968 Prime p such that p and p+2 are twin primes and p^2+p-1 p^2+p+1 are also twin primes.

Original entry on oeis.org

3, 5, 41, 59, 101, 2729, 3251, 9719, 11549, 12251, 19211, 28619, 41201, 47711, 49391, 55439, 58229, 61979, 63029, 63311, 79631, 81371, 85331, 103391, 122039, 135719, 153509, 157349, 164249, 167441, 178601, 188861, 197711, 208001, 209819, 216779, 219311, 226451
Offset: 1

Views

Author

Pierre CAMI, Sep 10 2013

Keywords

Comments

Subsequence of A088483.

Examples

			3 and 5 twin primes as 3*3+3-1=11 and 13, a(2)=3.
5 and 7 twin primes as 5*5+5-1=29 and 31, a(3)=5.
		

Crossrefs

Cf. A088483.

Programs

  • Mathematica
    Select[Transpose[Select[Partition[Prime[Range[21000]],2,1],#[[2]]-#[[1]] == 2&]][[1]],AllTrue[ #^2+#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 10 2014 *)
  • PARI
    is(n)=isprime(n)&&isprime(n+2)&&isprime(n^2+n-1)&&isprime(n^2+n+1) \\ Charles R Greathouse IV, Sep 10 2013
    
  • PFGW
    ABC2 $a & $a+2 & $a^2+$a-1 & $a^2+$a+1
    a: 1 to 3000000
    Charles R Greathouse IV, Sep 10 2013
    
  • Sage
    [x for x in primes_first_n(900) if x+2 in Primes() and x^2+x-1 in Primes() and x^2+x+1 in Primes()] #Tom Edgar, Sep 10 2013

A158295 Primes p such that p^3-p-+1 are twin primes.

Original entry on oeis.org

2, 11, 31, 41, 239, 521, 2309, 4099, 4409, 4441, 4651, 5009, 5039, 5261, 6481, 6871, 7129, 8609, 9391, 10259, 12841, 13759, 14519, 14879, 14939, 15569, 16871, 18451, 20369, 22441, 24049, 25841, 28151, 28279, 29429, 30181, 30631, 32089, 32299, 36781
Offset: 1

Views

Author

Keywords

Comments

Primes p such that p^3+p-+1 are twin primes, so far only one: 3. 3^3+3=30-+1 = primes.
Primes in the sequence A236524. Odd primes are congruent to either 1 mod 10 or 9 mod 10. - Derek Orr, Jan 27 2014

Examples

			2^3-2=6-+1 = 5,7 primes, 11^3-11-+1 = 1319,1321 primes...
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];a=p^3-p;If[PrimeQ[a-1]&&PrimeQ[a+1],AppendTo[lst,p]],{n,8!}];lst
    Select[Prime[Range[3500]],And@@PrimeQ[#^3-#+{1,-1}]&] (* Harvey P. Dale, Jan 05 2013 *)
  • PARI
    s=[]; forprime(p=2, 40000, if(isprime(p^3-p-1) && isprime(p^3-p+1), s=concat(s, p))); s /* Colin Barker, Jan 28 2014 */
  • Python
    import sympy
    from sympy import isprime
    {print(p) for p in range(10**5) if isprime(p) and isprime(p**3-p-1) and isprime(p**3-p+1)} # Derek Orr, Jan 27 2014
    

A088484 Sequence of the primes P = p(k)^2 + p(k) - 1 such that P and P + 2 are twin primes where p(k) denotes k-th prime.

Original entry on oeis.org

5, 11, 29, 1721, 3539, 8009, 10301, 17291, 552791, 579881, 1424441, 5815331, 7094231, 7450169, 9069131, 10378061, 10572251, 11899049, 22576751, 38112101, 43553399, 46696721, 52265669, 75160229, 82074539, 86927651, 90658961, 94468679, 94935791, 103052951, 116240741
Offset: 1

Views

Author

Pierre CAMI, Nov 09 2003

Keywords

Examples

			For k = 26, p(26) = 101, 101^2 + 101 - 1 = 10301, 10301 and 10303 twin primes, therefore 10301 is a term.
		

Crossrefs

p(k) given in A088483.

Programs

  • Mathematica
    f[n_] := n^2 + n - 1; f /@ Select[Range[10^4], And @@ PrimeQ[{#, f[#], f[#] + 2}] &] (* Amiram Eldar, Dec 27 2019 *)

Extensions

Corrected by T. D. Noe, Nov 15 2006
More terms from Amiram Eldar, Dec 27 2019

A155185 Primes in A155175.

Original entry on oeis.org

5, 13, 113, 1741, 5101, 8581, 9941, 21841, 26681, 47741, 82013, 481181, 501001, 1009621, 2356621, 2542513, 3279361, 3723721, 4277813, 7757861, 8124481, 13204661, 25311613, 30772013, 44170601, 48619661, 51521401, 52541501, 54236113, 60731221, 72902813
Offset: 1

Views

Author

Keywords

Comments

Hypotenuse C (prime numbers only) of primitive Pythagorean triangles such that perimeters are Averages of twin prime pairs, q=p+1, a=q^2-p^2, c=q^2+p^2, b=2*p*q, ar=a*b/2; s=a+b+c, s-+1 are primes. p=1,q=2,a=3,b=4,c=5=prime,s=12-+1primes, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n;q=p+1;a=q^2-p^2;c=q^2+p^2;b=2*p*q;ar=a*b/2;s=a+b+c;If[PrimeQ[s-1]&&PrimeQ[s+1],If[PrimeQ[c],AppendTo[lst,c]]],{n,8!}];lst (* corrected by Ray Chandler, Feb 11 2020 *)

Extensions

Sequence corrected by Ray Chandler, Feb 11 2020

A158296 Primes p such that 12*p^2 -+ 1 are twin primes.

Original entry on oeis.org

3, 11, 13, 17, 29, 227, 283, 491, 647, 739, 953, 1151, 1471, 1511, 1879, 1889, 2129, 2251, 2297, 2593, 2633, 3347, 3539, 3559, 3643, 3877, 3919, 4231, 4327, 4547, 4673, 4801, 4999, 5051, 6451, 6653, 6737, 6779, 6983, 7741, 7937, 8179, 8219, 8231, 8389
Offset: 1

Views

Author

Keywords

Examples

			3 is in the sequence since 12*3^2 = 108 and (107, 109) are twin primes.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];a=12*p^2;If[PrimeQ[a-1]&&PrimeQ[a+1],AppendTo[lst,p]],{n,7!}];lst
    Select[Prime[Range[1200]],AllTrue[12#^2+{1,-1},PrimeQ]&] (* Harvey P. Dale, Sep 15 2021 *)

A155186 Primes in A155171.

Original entry on oeis.org

2, 7, 29, 101, 107, 197, 227, 457, 647, 829, 1549, 1627, 2221, 2309, 2347, 2521, 2677, 2801, 3181, 3299, 3529, 3541, 3557, 3739, 3769, 4231, 4549, 4871, 4987, 5651, 5827, 5881, 6037, 6079, 6637, 6827, 7517, 7639, 7937, 9787, 11621, 12041, 12329, 13009
Offset: 1

Views

Author

Keywords

Comments

Numbers p (prime numbers only) of primitive Pythagorean triangles such that perimeters are Averages of twin prime pairs, q=p+1, a=q^2-p^2, c=q^2+p^2, b=2*p*q, s=a+b+c, s-+1 are primes.

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=n;q=p+1;a=q^2-p^2;c=q^2+p^2;b=2*p*q;ar=a*b/2;s=a+b+c;If[PrimeQ[s-1]&&PrimeQ[s+1],If[PrimeQ[p],AppendTo[lst,p]]],{n,8!}];lst

A158297 Primes p such that 12*p^3+-1 are twin primes.

Original entry on oeis.org

11, 239, 449, 619, 2099, 2711, 3109, 3889, 4591, 5519, 8539, 9719, 12071, 17981, 19441, 21569, 28949, 29399, 32771, 38189, 38201, 40709, 41771, 44699, 45949, 47149, 50741, 52189, 52379, 52501, 52639, 55339, 56249, 58831, 61561, 62861
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [p:p in PrimesUpTo(63000)| IsPrime(12*p^3-1) and NextPrime(12*p^3-1) eq 12*p^3+1]; // Marius A. Burtea, Jan 23 2020
  • Mathematica
    lst={};Do[p=Prime[n];a=12*p^3;If[PrimeQ[a-1]&&PrimeQ[a+1],AppendTo[lst,p]],{n,8!}];lst
    Select[Prime[Range[7000]],AllTrue[12#^3+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Aug 03 2019 *)

A286319 Prime p such that p^2-p-1 or p^2+p-1 is the smallest prime of a twin prime pair.

Original entry on oeis.org

2, 3, 5, 7, 41, 59, 67, 89, 101, 131, 139, 379, 457, 743, 761, 1193, 1201, 1381, 1549, 1567, 1747, 1789, 2137, 2411, 2557, 2647, 2663, 2729, 2731, 3011, 3221, 3251, 3449, 4057, 4159, 4447, 4561, 4751, 5179, 5641, 6173, 6397, 6599, 6833, 7229, 8669, 9059, 9157, 9323
Offset: 1

Views

Author

Pierre CAMI, May 11 2017

Keywords

Comments

Union of A088483 and A120364.
3 is the only prime such that p^2-p-1 and p^2+p-1 are both the smallest of a prime twin pair.
For prime p > 3 if p+1 is divisible by 6 then the smallest prime of the prime twin pair is p^2+p-1 and p^2-p-1 if not.

Examples

			2^2+2-1=5 and (5,7) is a twin prime pair so a(1)=2.
3^2-3-1=5, 3^2+3-1=11 and (5,7), (11,13) are twin prime pairs so a(2)=3.
5^2+5-1=29 and (29,31) is a twin prime pair so a(3)=5.
7^2-7-1=41 and (41,43) is a twin prime pair so a(4)=7.
		

Crossrefs

Programs

  • Mathematica
    sptppQ[n_]:=AllTrue[{n^2-n-1,n^2-n+1},PrimeQ]||AllTrue[{n^2+n-1,n^2+ n+ 1},PrimeQ]; Select[Prime[Range[1200]],sptppQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 04 2019 *)
Showing 1-10 of 12 results. Next