A088497 Duplicate of A088485.
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
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.
a(7) = 101: 101*101 + 101 - 1 = 10301, 10301 and 10303 twin primes.
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 *)
forprime(p=2,1e5,if(isprime(p^2+p-1)&&isprime(p^2+p+1),print1(p", "))) \\ Charles R Greathouse IV, Dec 27 2011
Triangle begins: 1: 1 -> 0 primes, 2: 3,5 -> 2 primes, 3: 7,9,11 -> 2 primes, 4: 13,15,17,19 -> 3 primes.
a108309 = sum . (map a010051) . a176271_row -- Reinhard Zumkeller, May 24 2012
seq(numtheory:-pi(n^2+n-1)-numtheory:-pi(n^2-n),n=1..100); # Robert Israel, Sep 03 2014
f[n_] := PrimePi[n^2 + n - 1] - PrimePi[n^2 - n]; Table[f[n], {n, 81}] (* Ray Chandler, Jul 26 2005 *)
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.
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 *)
20*20 + 20 - 1 = 419, 419 and 421 twin primes, 419 is the 7th of the sequence for k = 20.
Select[Table[k(k+1)-1,{k,500}],AllTrue[#+{0,2},PrimeQ]&] (* Harvey P. Dale, Jul 08 2024 *)
3*4=12: 11 and 13 are twin primes; 3*6=18 and 17 and 19 are also twin primes.
Select[Range[106000],AllTrue[{#*(#+1)-1,#*(#+1)+1,#*(#+3)-1,#*(#+3)+1},PrimeQ]&] (* James C. McMahon, Jun 06 2025 *)
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
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.
[k:k in [1..1750]| IsPrime(k^2+k+3) and IsPrime(k^2+k-3)]; // Marius A. Burtea, Feb 17 2020
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 *)
a(1)=3 as 12+-5 are primes. a(2)=6 as 42+-5 are primes.
select(n -> isprime(n^2+n+5) and isprime(n^2+n-5), [$1..2000]); # Robert Israel, Nov 26 2017
q=5;lst5={};Do[p=n^2+n;If[PrimeQ[p-q]&&PrimeQ[p+q],AppendTo[lst5,n]], {n,0,7!}];lst5
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.
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}]
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.
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
Select[Range[568000],AllTrue[Flatten[{#^2+#+{1,-1},#^2-#+{1,-1}},1],PrimeQ]&] (* Harvey P. Dale, Jul 31 2022 *)
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)}
Comments