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

A088497 Duplicate of A088485.

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
Offset: 1

Views

Author

Keywords

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

Original entry on oeis.org

2, 3, 5, 41, 59, 89, 101, 131, 743, 761, 1193, 2411, 2663, 2729, 3011, 3221, 3251, 3449, 4751, 6173, 6599, 6833, 7229, 8669, 9059, 9323, 9521, 9719, 9743, 10151, 10781, 11549, 11933, 12143, 12251, 12473, 12641, 13553, 13613, 14939, 15569, 16301
Offset: 1

Views

Author

Pierre CAMI, Nov 09 2003

Keywords

Comments

Also primes in A155173 = Short leg A of primitive Pythagorean triangles such that perimeters are Averages of twin prime pairs... - Vladimir Joseph Stephan Orlovsky, Jan 21 2009
All terms >3 are congruent to 5 modulo 6. - Zak Seidov, Mar 21 2014
Intersection of A000040 and A088485. - Danny Rorabaugh, May 15 2017

Examples

			a(7) = 101: 101*101 + 101 - 1 = 10301, 10301 and 10303 twin primes.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[p1=p*p+p-1]&&PrimeQ[p1+2],AppendTo[lst,p]],{n,2*7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 21 2009 *)
    Select[Prime[Range[2000]],AllTrue[#^2+#+{1,-1},PrimeQ]&] (* Harvey P. Dale, Feb 22 2023 *)
  • PARI
    forprime(p=2,1e5,if(isprime(p^2+p-1)&&isprime(p^2+p+1),print1(p", "))) \\ Charles R Greathouse IV, Dec 27 2011

A108309 Consider the triangle of odd numbers where the n-th row has the next n odd numbers. The sequence is the number of primes in the n-th row.

Original entry on oeis.org

0, 2, 2, 3, 2, 3, 3, 4, 4, 5, 3, 4, 6, 4, 6, 6, 4, 6, 7, 6, 8, 7, 5, 8, 9, 8, 7, 8, 9, 8, 9, 10, 10, 8, 10, 12, 5, 12, 12, 13, 9, 11, 11, 9, 13, 14, 9, 14, 14, 10, 10, 19, 14, 12, 12, 12, 12, 16, 15, 16, 15, 13, 18, 16, 16, 12, 16, 17, 15, 16, 18, 14, 15, 20, 18, 19, 14, 19, 20, 18, 16
Offset: 1

Views

Author

Giovanni Teofilatto, Jul 25 2005

Keywords

Comments

Except for the initial term, a(n)>=2 because in the interval 2n-1 of odd numbers there are always at least two primes.
For n>2, this is the same as the number of primes between n^2-n and n^2+n, which is the sum of A089610 and A094189. - T. D. Noe, Sep 16 2008
a(n) = SUM(A010051(A176271(n,k)): 1<=k<=n). - Reinhard Zumkeller, Apr 13 2010
From Pierre CAMI, Sep 03 2014: (Start)
For n>1 a(n)~floor(1/2 + n/log(n)).
The number of primes < n^2 is ~ n^2/2/log(n) by the prime number theorem, as a(n) ~ floor(1/2 + n/log(n)) we have:
n^2/2/log(n) ~ 1 + floor(1/2 + 2/log(2)) + floor(1/2 + 3/log(3)) + floor(1/2 + 4/log(4)) + ... + floor(1/2 + (n-1)/log(n-1)) + floor(1/2 + n/log(n)).
For n=16000 the number of primes < n^2 is 13991985, the sum: 1 + floor(1/2 + 2/log(2)) + floor(1/2 + 3/log(3)) + floor(1/2 + 4/log(4))+ ... + floor(1/2 + (n-1)/log(n-1)) + floor(1/2 + n/log(n)) is 13991101 and (n^2)/(2*log(n)) is 13222671.
So between n^2+n and n^2+3*n there are n odd numbers and ~floor(1/2 + n/log(n)) prime numbers.
The twin primes are of the form T1=n^2+n-1 and T2=n^2+n+1, or n^2+n+T1 and n^2+n+T2 with T1<=2*n-1, or n^2+n+P and n^2+n+P(-2 or +2) with P prime <=2*n-1.
(End)

Examples

			Triangle begins:
1: 1 -> 0 primes,
2: 3,5 -> 2 primes,
3: 7,9,11 -> 2 primes,
4: 13,15,17,19 -> 3 primes.
		

Crossrefs

Programs

  • Haskell
    a108309 = sum . (map a010051) . a176271_row
    -- Reinhard Zumkeller, May 24 2012
  • Maple
    seq(numtheory:-pi(n^2+n-1)-numtheory:-pi(n^2-n),n=1..100); # Robert Israel, Sep 03 2014
  • Mathematica
    f[n_] := PrimePi[n^2 + n - 1] - PrimePi[n^2 - n]; Table[f[n], {n, 81}] (* Ray Chandler, Jul 26 2005 *)

Extensions

Edited and extended by Ray Chandler, Jul 26 2005

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

A088486 Primes p of the form k*(k + 1) - 1 such that p and p + 2 are twin primes.

Original entry on oeis.org

5, 11, 29, 41, 71, 239, 419, 461, 599, 1481, 1721, 2549, 2969, 3539, 4421, 8009, 10301, 17291, 19181, 20021, 23561, 24179, 27059, 31151, 35531, 41411, 42641, 43889, 46439, 47741, 53591, 55931, 60761, 83231, 84389, 95789, 98909, 123551, 143261, 156419, 164429
Offset: 1

Views

Author

Pierre CAMI, Nov 09 2003

Keywords

Comments

a(n) + 1 is an oblong number (A002378). - Michel Marcus, Feb 04 2017

Examples

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

Crossrefs

Programs

  • Mathematica
    Select[Table[k(k+1)-1,{k,500}],AllTrue[#+{0,2},PrimeQ]&] (* Harvey P. Dale, Jul 08 2024 *)

Formula

a(n) = A088485(n)*(A088485(n) + 1) - 1. - R. J. Mathar, Nov 14 2009

Extensions

Sign in definition corrected by R. J. Mathar, Nov 13 2009

A138303 Numbers k such that k*(k+1)-1 and k*(k+1)+1 are twin primes and k*(k+3)-1 and k*(k+3)+1 are also twin primes.

Original entry on oeis.org

3, 15, 495, 624, 1308, 1365, 1494, 1659, 1848, 6363, 8064, 12780, 13908, 14013, 16530, 18018, 18654, 28575, 30885, 31020, 38130, 43674, 48735, 50379, 57198, 60915, 61059, 62943, 75768, 76359, 76569, 80949, 81075, 83028, 84045, 86085, 88185, 104664, 105588
Offset: 1

Views

Author

Pierre CAMI, Mar 13 2008

Keywords

Examples

			3*4=12: 11 and 13 are twin primes; 3*6=18 and 17 and 19 are also twin primes.
		

Crossrefs

Subsequence of A088485.

Programs

  • Mathematica
    Select[Range[106000],AllTrue[{#*(#+1)-1,#*(#+1)+1,#*(#+3)-1,#*(#+3)+1},PrimeQ]&] (* James C. McMahon, Jun 06 2025 *)
  • PARI
    isok(n) = isprime(n*(n+1)-1) && isprime(n*(n+1)+1) && isprime(n*(n+3)-1) &&  isprime(n*(n+3)+1); \\ Michel Marcus, Sep 23 2019

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

Original entry on oeis.org

4, 7, 10, 22, 25, 34, 70, 79, 112, 130, 139, 172, 187, 217, 229, 262, 274, 295, 304, 322, 337, 364, 397, 400, 472, 499, 574, 580, 592, 622, 634, 655, 664, 697, 829, 844, 925, 1057, 1144, 1165, 1255, 1300, 1309, 1357, 1414, 1420, 1489, 1537, 1642, 1669, 1744
Offset: 1

Views

Author

Keywords

Examples

			4 is in the list because 16+4+-3 = 23 and 17 are primes.
7 is in the list because 49+7+-3 = 53 and 59 are primes.
		

Crossrefs

Programs

  • Magma
    [k:k in [1..1750]| IsPrime(k^2+k+3) and IsPrime(k^2+k-3)]; // Marius A. Burtea, Feb 17 2020
  • Mathematica
    q=3;lst3={};Do[p=n^2+n;If[PrimeQ[p-q]&&PrimeQ[p+q],AppendTo[lst3,n]],{n,0,7!}];lst3
    Select[Range[2000],AllTrue[#^2+#+{3,-3},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 01 2019 *)

Extensions

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

A161864 Numbers n such that n^2 + n + 5 and n^2 + n - 5 are both prime.

Original entry on oeis.org

3, 6, 11, 18, 21, 23, 27, 32, 42, 48, 51, 83, 86, 93, 116, 153, 158, 182, 188, 216, 282, 291, 317, 333, 396, 482, 681, 737, 786, 798, 818, 821, 872, 923, 956, 966, 977, 986, 1007, 1026, 1077, 1082, 1106, 1161, 1287, 1292, 1302, 1337, 1341, 1451, 1467, 1563
Offset: 1

Views

Author

Keywords

Examples

			a(1)=3 as 12+-5 are primes. a(2)=6 as 42+-5 are primes.
		

Crossrefs

Programs

  • Maple
    select(n -> isprime(n^2+n+5) and isprime(n^2+n-5), [$1..2000]); # Robert Israel, Nov 26 2017
  • Mathematica
    q=5;lst5={};Do[p=n^2+n;If[PrimeQ[p-q]&&PrimeQ[p+q],AppendTo[lst5,n]], {n,0,7!}];lst5

Extensions

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

A230516 Number of ways to write n = a + b + c with 0 < a <= b <= c such that {a^2+a-1, a^2+a+1}, {b^2+b-1, b^2+b+1}, {c^2+c-1, c^2+c+1} are twin prime pairs.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 3, 2, 2, 2, 2, 3, 4, 4, 3, 5, 5, 4, 6, 6, 4, 4, 4, 3, 3, 4, 1, 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 6, 4, 3, 5, 4, 4, 3, 5, 5, 6, 8, 6, 7, 11, 7, 6, 9, 8, 4, 8, 6, 5, 7, 5, 4, 8, 10, 5, 7, 9, 6, 10, 6, 7, 7, 7, 4, 4, 8, 5, 5, 4, 6, 9, 7, 7, 7, 7, 7, 8
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 22 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 5.
Conjecture verified for n up to 10^9. - Mauro Fiorentini, Sep 22 2023
This implies that there are infinitely many twin prime pairs of the form {x^2 + x - 1, x^2 + x + 1}.
See also A230514 for a similar conjecture.

Examples

			a(8) = 1 since 8 = 2 + 3 + 3, and {2*3 - 1, 2*3 + 1} = {5, 7} and {3*4 - 1, 3*4 + 1} = {11, 13} are twin prime pairs.
a(39) = 1 since 39 = 3 + 15 + 21, and {3*4 - 1, 3*4 + 1} = {11, 13}, {15*16 - 1, 15*16 + 1} = {239, 241}, {21*22 - 1, 21*22 + 1} = {461, 463} are twin prime pairs.
		

Crossrefs

Programs

  • Mathematica
    pp[n_]:=PrimeQ[n(n+1)-1]&&PrimeQ[n(n+1)+1]
    a[n_]:=Sum[If[pp[i]&&pp[j]&&pp[n-i-j],1,0],{i,1,n/3},{j,i,(n-i)/2}]
    Table[a[n],{n,1,100}]

A236056 Numbers k such that k^2 +- k +- 1 is prime for all four possibilities.

Original entry on oeis.org

3, 6, 21, 456, 1365, 2205, 2451, 2730, 8541, 18486, 32199, 32319, 32781, 45864, 61215, 72555, 72561, 82146, 83259, 86604, 91371, 95199, 125334, 149331, 176889, 182910, 185535, 210846, 225666, 226254, 288420, 343161, 350091, 403941, 411501, 510399, 567204
Offset: 1

Views

Author

Derek Orr, Jan 18 2014

Keywords

Comments

The only prime in this sequence is a(1) = 3.

Examples

			1365^2 + 1365 + 1 = 1864591,
1365^2 + 1365 - 1 = 1864589,
1365^2 - 1365 + 1 = 1861861, and
1365^2 - 1365 - 1 = 1861859 are all prime, so 1365 is a term of this sequence.
		

Crossrefs

Numbers in the intersection of A002384, A045546, A055494, and A002328.
Numbers in the intersection of A131530 and A088485.

Programs

  • Maple
    q:= k-> andmap(isprime, [seq(seq(k^2+i+j, j=[k, -k]), i=[1, -1])]):
    select(q, [3*t$t=1..200000])[];  # Alois P. Heinz, Feb 25 2020
  • Mathematica
    Select[Range[568000],AllTrue[Flatten[{#^2+#+{1,-1},#^2-#+{1,-1}},1],PrimeQ]&] (* Harvey P. Dale, Jul 31 2022 *)
  • Python
    import sympy
    from sympy import isprime
    {print(p) for p in range(10**6) if isprime(p**2+p+1) and isprime(p**2-p+1) and isprime(p**2+p-1) and isprime(p**2-p-1)}
Showing 1-10 of 18 results. Next