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

A265006 Twin prime pairs of the form (k^2 + k - 1, k^2 + k + 1).

Original entry on oeis.org

5, 7, 11, 13, 29, 31, 41, 43, 71, 73, 239, 241, 419, 421, 461, 463, 599, 601, 1481, 1483, 1721, 1723, 2549, 2551, 2969, 2971, 3539, 3541, 4421, 4423, 8009, 8011, 10301, 10303, 17291, 17293, 19181, 19183, 20021, 20023, 23561, 23563, 24179, 24181, 27059, 27061, 31151, 31153, 35531, 35533
Offset: 1

Views

Author

Bill McEachen, Nov 29 2015

Keywords

Comments

This is a subset of A002327 and A002383 taken together. Note that 3 is not a member, as the pairing (3, 5) is excluded as defined, as 3 and 5 associate to different centers.
The corresponding n are in A088485.
The average of each twin prime pair is an oblong number (A002378). - Michel Marcus, Feb 04 2017

Examples

			For k = 6, k^2 + k = 6^2 + 6 = 42, and (41,43) is a twin prime pair, so 41 and 43 are in the sequence.
		

Crossrefs

Programs

  • Magma
    &cat[[n^2+n-1, n^2+n+1]: n in [0..250]| IsPrime(n^2+n-1) and IsPrime(n^2+n+1)]; // Vincenzo Librandi, Feb 05 2017
  • Mathematica
    {#^2 + # - 1, #^2 + # + 1} & /@ Select[Range@ 200, PrimeQ[#^2 + # - 1] && PrimeQ[#^2 + # + 1] &] // Flatten (* Michael De Vlieger, Nov 30 2015 *)
    Flatten[Select[Table[n^2 + n + {-1, 1}, {n, 0, 200}], And@@PrimeQ[#] &]] (* Vincenzo Librandi, Feb 05 2017 *)
  • PARI
    genit()={my(maxx=1000);n=0;while(n
    				

Formula

a(2n-1) = A088486(n). a(2n)=2+a(2n-1).

A088498 Numbers k such that k^2 + k - 1 and k^2 + k + 1 are twin primes and (k + 1)*(k + 1) + k + 1 - 1 and (k + 1)*(k + 1) + k + 1 + 1 are also twin primes.

Original entry on oeis.org

2, 5, 20, 455, 1364, 2204, 2450, 2729, 8540, 18485, 32198, 32318, 32780, 45863, 61214, 72554, 72560, 82145, 83258, 86603, 91370, 95198, 125333, 149330, 176888, 182909, 185534, 210845, 225665, 226253, 288419, 343160, 350090, 403940, 411500
Offset: 1

Views

Author

Pierre CAMI, Nov 11 2003

Keywords

Examples

			20 is a term since 20^2 + 20 - 1 = 419, 419 and 421 are twin primes, 21^2 + 21 - 1 = 461, and 461 and 463 are also twin primes.
		

Crossrefs

Cf. A088485.

Programs

  • Mathematica
    Select[ Range[510397], PrimeQ[ #^2 + # - 1] && PrimeQ[ #^2 + # + 1] && PrimeQ[ #^2 + 3# + 1] && PrimeQ[ #^2 + 3# + 3] & ]
     Select[Range[412000],AllTrue[Flatten[{#^2+#+{1,-1},(#+1)(#+1)+#+{0,2}}], PrimeQ]&] (* Harvey P. Dale, Feb 12 2022 *)

Extensions

Corrected and extended by Ray Chandler and Robert G. Wilson v, Nov 12 2003

A161866 Numbers k such that k^2+k+7 and k^2+k-7 are both prime.

Original entry on oeis.org

3, 5, 9, 12, 24, 29, 32, 39, 44, 50, 57, 59, 65, 102, 135, 137, 144, 170, 180, 207, 260, 267, 297, 302, 305, 344, 347, 360, 365, 369, 389, 404, 429, 464, 474, 495, 540, 555, 570, 612, 620, 659, 662, 689, 767, 774, 792, 824, 837, 872, 885, 900, 950, 954, 989
Offset: 1

Views

Author

Keywords

Examples

			a(1)=3 as 12+-7 are primes. a(2)=5 as 30+-7 are primes.
		

Crossrefs

Programs

  • Magma
    [k:k in [1..1000]| IsPrime(k^2+k+7) and IsPrime(k^2+k-7)]; // Marius A. Burtea, Feb 17 2020
  • Mathematica
    q=7;lst7={};Do[p=n^2+n;If[PrimeQ[p-q]&&PrimeQ[p+q],AppendTo[lst7,n]], {n,0,7!}];lst7
    Select[Range[1000],AllTrue[#^2+#+{7,-7},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 26 2021 *)

Extensions

Definition rephrased by R. J. Mathar, Jun 23 2009

A173297 Numbers k such that exactly one of k^2 + k - 1 and k^2 + k + 1 is prime.

Original entry on oeis.org

1, 4, 9, 10, 11, 12, 13, 14, 16, 17, 19, 26, 27, 28, 30, 31, 33, 35, 39, 44, 45, 46, 48, 53, 55, 56, 57, 60, 62, 64, 65, 68, 69, 70, 71, 75, 76, 77, 78, 80, 83, 85, 86, 90, 93, 94, 96, 99, 100, 103, 105, 110, 111, 114, 115, 117, 119, 120, 125, 126, 130, 134, 140, 143, 144
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 15 2010

Keywords

Comments

Numbers k such that either k-th oblong number-+1 is prime.
Indices k such that A002378(k)+1 or A002378(k)-1 is prime, but not both. -R. J. Mathar, Feb 21 2010

Crossrefs

Programs

  • Maple
    isA173297 := proc(n) local p,pplus,pmin ; pmin := isprime(n*(1+n)-1) ; pplus := isprime(n*(1+n)+1) ; if pmin <> pplus then return true; else return false; end if; end proc: for n from 1 to 300 do if isA173297(n) then printf("%d,",n) ; end if; end do ; # R. J. Mathar, Feb 21 2010

Extensions

46 and 86 inserted by R. J. Mathar, Feb 21 2010
Edited by Charles R Greathouse IV, Mar 24 2010

A214840 Averages y of twin prime pairs that satisfy y = x^2 + x - 2.

Original entry on oeis.org

4, 18, 108, 180, 270, 810, 4158, 4968, 5850, 7308, 10710, 13338, 17028, 26730, 32940, 38610, 70488, 72090, 102078, 117990, 122148, 128520, 132858, 153270, 228960, 231840, 240588, 246510, 249498, 296478, 326610, 372708, 391248, 417960, 429678, 449568, 453600
Offset: 1

Views

Author

Michael G. Kaarhus, Mar 07 2013

Keywords

Comments

The above equation is one of a family of twin prime average-generating quadratics y = x^2 + x - c, where c can be any even integer not of the form 6d + 4.
For f(x) = x^2 + x - c, f(-x) = f(x-1).
If c = 0, the positive x that satisfy y = x^2 + x - c are A088485.

Examples

			x =  2,  x =  4,  x = 10,  x = 13,  x = 16
x = 28,  x = 64,  x = 70,  x = 76,  x = 85
		

Crossrefs

Subsequence of A014574. Cf. A088485.

Programs

  • Mathematica
    s = {4}; Do[If[PrimeQ[n - 1] && PrimeQ[n + 1] && IntegerQ[Sqrt[9 + 4 n]], AppendTo[s, n]], {n, 18, 453600, 6}]; s (* Zak Seidov, Mar 21 2013 *)
    Select[Mean/@Select[Partition[Prime[Range[100000]],2,1],#[[2]]-#[[1]]==2&],IntegerQ[ Sqrt[ 9+4#]]&] (* Harvey P. Dale, Aug 18 2024 *)
  • PARI
    p=2;forprime(q=3,1e6,if(q-p>2,p=q;next);n=sqrtint(y=(p+q)\2);if(n^2+n-2==y,print1(y", "));p=q) \\ Charles R Greathouse IV, Mar 20 2013
    
  • PARI
    test(y)=if(isprime(y-1)&&isprime(y+1),print1(", "y))
    print1(4);for(n=0,100,test(18*n*(2*n+1));test(18*(2*n^2+3*n+1))) \\ Charles R Greathouse IV, Mar 20 2013

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 *)

A303550 Numbers k such that abs(60*k^2 - 1710*k + 12150) +- 1 are twin primes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 38, 41, 50, 56, 57, 64, 66, 69, 75, 81, 85, 86, 90, 93, 98, 103, 106, 119, 121, 133, 136, 141, 143, 146, 150, 181, 182, 189, 195, 202, 207, 208, 212, 215, 218, 219, 225
Offset: 1

Views

Author

Amiram Eldar, Apr 26 2018

Keywords

Comments

The formula was discovered by Andrew T. Gazsi in 1961.
The polynomial can also be given as 30*(2*k - 27)*(k - 15). Its value is negative (-30) at k = 14 and 0 and k = 15.
Beiler erroneously claimed that the polynomial generates twin primes for k = 1 to 20.

Examples

			1 is in the sequence since 60*1^2 - 1710*1 + 12150 = 10500 and (10499, 10501) are twin primes.
		

References

  • Albert H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, 2nd ed., Dover Publications, Inc., New York, 1966, p. 225.
  • Joseph B. Dence and Thomas P. Dence, Elements of the Theory of Numbers, Academic Press, 1999, problem 1.94, p.35.
  • Andrew T. Gazsi, A Formula to Generate Prime Pairs, Recreational Mathematics Magazine, edited by Joseph S. Madachy, Issue 6, December 1961, p. 44.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local k;
      k:= abs(60*n^2-1710*n+12150);
      isprime(k+1) and isprime(k-1)
    end proc:
    select(filter, [$1..300]); # Robert Israel, Jun 19 2018
  • Mathematica
    f[n_] := 60n^2 - 1710n + 12150; aQ[n_]:=PrimeQ[f[n]-1] && PrimeQ[f[n]+1]; Select[Range[225], aQ]
    Select[Range[250],AllTrue[Abs[60#^2-1710#+12150+{1,-1}],PrimeQ]&] (* Harvey P. Dale, May 17 2025 *)
  • PARI
    f(n) = abs(60*n^2 - 1710*n + 12150);
    isok(n) = my(fn=f(n)); isprime(fn-1) && isprime(fn+1); \\ Michel Marcus, Apr 27 2018

A248081 Least number k such that k^n + k +/- 1 are twin primes, or 0 if no such k exists.

Original entry on oeis.org

2, 2, 3, 2, 0, 8, 462, 0, 15, 3, 0, 30, 1500, 0, 30, 2, 0, 371, 11058, 0, 11289, 1599, 0, 4139, 44994, 0, 36951, 54, 0, 651, 2088, 0, 8841, 13061, 0, 81, 83406, 0, 20451, 3291, 0, 1821, 1128, 0, 122070, 20534, 0, 57852, 82875, 0, 15150, 132, 0, 515, 7215, 0, 37470, 2375, 0, 2340
Offset: 1

Views

Author

Derek Orr, Sep 30 2014

Keywords

Comments

For n > 2, if n == 2 (mod 3), then k^n + k + 1 is divisible by k^2 + k + 1. Thus it will never be prime.

Crossrefs

Programs

  • PARI
    a(n)=if(n>2&&n==Mod(2,3),return(0));k=1;while(!ispseudoprime(k^n+k-1)||!ispseudoprime(k^n+k+1),k++);k
    n=1;while(n<50,print1(a(n),", ");n++)
Previous Showing 11-18 of 18 results.