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

A339698 Primes of the form p^2 - p*q + q^2, where p and q are consecutive primes.

Original entry on oeis.org

7, 19, 3163, 23743, 28927, 70783, 141403, 198943, 223837, 265333, 283267, 329503, 1136383, 1223263, 1254427, 1488427, 2238043, 2421163, 3625243, 3904603, 4709143, 4884127, 5216683, 5784133, 7376683, 8065627, 8797183, 10660333, 11242717, 12348223, 16613803, 18594019, 19202167, 19999027
Offset: 1

Views

Author

Zak Seidov, Dec 13 2020

Keywords

Examples

			a(2) = 19 = 3^2 - 3*5 + 5^2 is the only prime obtained with a pair of twin primes: (3, 5). - _Bernard Schott_, Dec 23 2020
		

Crossrefs

Cf. A243761 (similar, with p^2 + p*q + q^2), A339920 (the primes p).

Programs

  • Mathematica
    Select[Map[#1^2 - #1 #2 + #2^2 & @@ # &, Partition[Prime@ Range[610], 2, 1]], PrimeQ] (* Michael De Vlieger, Dec 13 2020 *)
  • PARI
    forprime(p=1, 1e4, my(q=nextprime(p+1), x=p^2-p*q+q^2); if(ispseudoprime(x), print1(x, ", "))) \\ Felix Fröhlich, Dec 14 2020
    
  • PARI
    first(n) = { my(q = 2, p, res = vector(n), t = 0); forprime(p = 3, oo, c = p^2 - p*q + q^2; if(isprime(c), t++; res[t] = c; if(t >= n, return(res) ) ); q = p; ) } \\ David A. Corneth, Dec 19 2020

A252017 Primes of the form (p + q)^3 + 3, where p and q are consecutive primes.

Original entry on oeis.org

140611, 1000003, 68921003, 81746507, 105154051, 360944131, 709732291, 1643032003, 8072216219, 8390176771, 10021812419, 10823192131, 11239424003, 14526784003, 15363967259, 17014253251, 23689358851, 24693014531, 26784575491, 27270901003, 27928443307, 36594368003
Offset: 1

Views

Author

K. D. Bajpai, Dec 13 2014

Keywords

Examples

			140611 is in the sequence because (23 + 29)^3 + 3 = 140611 which is prime: 23 and 29 are consecutive primes.
81746507 is in the sequence because (211 + 223)^3 + 3 = 81746507 which is prime: 211 and 223 are consecutive primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[(Prime[n] + Prime[n + 1])^3 + 3, {n, 500}], PrimeQ[#] &]
  • PARI
    s=[]; for(k=1, 500, t=(prime(k) + prime(k+1))^3 + 3; if(isprime(t), s=concat(s, t))); s

A243904 Semiprimes of the form p^2 + pq + q^2, where p, q are consecutive primes.

Original entry on oeis.org

49, 247, 679, 973, 2701, 5293, 7509, 10801, 12297, 15553, 17337, 25963, 29407, 33079, 34993, 36967, 43249, 53877, 67501, 71157, 76809, 97201, 117613, 155953, 181573, 225237, 270049, 292033, 297679, 314977, 350917, 380217, 477607, 492091, 514213, 632047, 648679
Offset: 1

Views

Author

K. D. Bajpai, Jun 14 2014

Keywords

Comments

Intersection of A001358 and A003136.

Examples

			247 is in the sequence because 7^2 + 7*11 + 11^2 = 247 = 13*19, which is semiprime.
679 is in the sequence because 13^2 + 13*17 + 17^2 = 679 = 7*97, which is semiprime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A243904:= proc() local k, p, q; p:=ithprime(n); q:=ithprime(n+1); k:=p^2 + p*q + q^2;  if bigomega(k)=2 then RETURN (k); fi; end: seq(A243904 (), n=1..200);
  • Mathematica
    Select[Table[Prime[n]^2 + Prime[n] Prime[n + 1] + Prime[n + 1]^2, {n, 100}], PrimeOmega[#] == 2 &]
  • PARI
    issemi(n)=bigomega(n)==2
    list(lim)=my(v=List(),p=3,t); forprime(q=5,, t=p^2+p*q+q^2; if(t>lim, break); if(issemi(t), listput(v,t)); p=q); Vec(v) \\ Charles R Greathouse IV, Jul 05 2017

A252231 Primes of the form (p+q)^2 + pq, where p and q are consecutive primes.

Original entry on oeis.org

31, 79, 179, 401, 719, 1619, 3371, 8819, 12491, 15671, 23801, 25919, 28871, 32801, 95219, 118571, 154871, 161999, 190121, 266801, 322571, 364499, 375371, 449951, 524831, 725801, 772229, 796001, 820109, 994571, 1026029, 1053401, 1081121, 1225109, 1326089, 1415039
Offset: 1

Views

Author

K. D. Bajpai, Dec 15 2014

Keywords

Examples

			79 is in the sequence because (3+5)^2 + 3*5 = 79, which is prime.
401 is in the sequence because (7+11)^2 + 7*11 = 401, which is prime.
		

Crossrefs

Programs

  • Maple
    count:= 0:
    p:= 2:
    while count < 100 do
      q:= nextprime(p);
      x:= (p+q)^2+p*q;
      if isprime(x) then
        count:= count+1;
        a[count]:= x;
      fi;
      p:= q;
    od:
    seq(a[i],i=1..count); # Robert Israel, Dec 16 2014
  • Mathematica
    Select[Table[(Prime[n] + Prime[n+1])^2 + Prime[n]Prime[n+1], {n,100}], PrimeQ[#] &]
    Select[Total[#]^2+Times@@#&/@Partition[Prime[Range[100]],2,1],PrimeQ] (* Harvey P. Dale, Sep 06 2020 *)
  • PARI
    s=[]; for(k=1, 100, p=prime(k); q=prime(k+1); t=(p+q)^2 + p*q; if(isprime(t), s=concat(s, t))); s

A270249 Greater of a pair of twin primes (r,s=r+2) where s is of the form p^2 + pq + q^2 and p and q are also twin primes.

Original entry on oeis.org

109, 433, 2056753, 3121201, 3577393, 26462701, 37340353, 43823053, 128786113, 202705201, 304093873, 888345793, 1005988033, 1399680001, 1537437133, 2282300173, 2310187501, 2444964913, 2929312513, 3564542701, 5831255233, 7950571201, 8512439473, 9346947373, 9648752833, 12627464653, 15624660673
Offset: 1

Views

Author

Altug Alkan, Mar 14 2016

Keywords

Comments

Subsequence of A243761.
How is the distribution of terms of this sequence? With this form p^2 + pq + q^2, do twin primes generate bigger twin primes infinitely many times?

Examples

			109 is a term because 109 and 107 are twin primes and 109 = 5^2 + 5*7 + 7^2, 5 and 7 are also twin primes.
433 is a term because 433 and 431 are twin primes and 433 = 11^2 + 11*13 + 13^2, 11 and 13 are also twin primes.
		

Crossrefs

Programs

  • PARI
    t(n, p=3) = {while( p+2 < (p=nextprime( p+1 )) || n-->0, ); p-2}
    for(n=1, 1e3, if(ispseudoprime(P=(3*t(n)^2 + 6*t(n) + 4)) && ispseudoprime(P-2), print1(P, ", ")));
    
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A270249_gen(): # generator of terms
        p, q = 2, 3
        while True:
            if q-p == 2 and isprime(s:=3*p*q+4) and isprime(s-2):
                yield s
            p, q = q, nextprime(q)
    A270249_list = list(islice(A270249_gen(),20)) # Chai Wah Wu, Feb 27 2023

A360490 a(n) = (1/2) * A241102(n).

Original entry on oeis.org

109, 433, 172801, 238573, 363313, 640333, 1145773, 1968301, 2056753, 3121201, 3577393, 6588973, 11197873, 13079233, 13381633, 15431473, 21676033, 26462701, 34476301, 37340353, 43823053, 48481201, 54749953, 56454733, 90816013, 96038893, 102667501, 128786113
Offset: 1

Views

Author

Ya-Ping Lu, Feb 09 2023

Keywords

Comments

Primes which are half the difference between 2 cubes of primes.
Primes of the form 3*m^2 + 1, where m is the average of a twin prime pair (A014574).
A subsequence of A243761 and a supersequence of A270249.

Examples

			172801 is a term because 172801 = (241^3 - 239^3)/2, and 172801, 239 and 241 are all primes.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A360490_gen(): # generator of terms
        p, q = 3**3, 5
        while True:
            if isprime(k:=(m:=q**3)-p>>1):
                yield k
            p, q = m, nextprime(q)
    A360490_list = list(islice(A360490_gen(),20)) # Chai Wah Wu, Feb 27 2023

Formula

a(n) = (1/2) * A241102(n).
Showing 1-6 of 6 results.