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

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
Showing 1-1 of 1 results.