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.

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

Original entry on oeis.org

19, 109, 433, 1327, 4567, 6079, 19687, 49927, 62233, 103813, 160087, 172801, 238573, 363313, 395323, 463363, 583447, 640333, 753007, 1145773, 1529413, 1728247, 1968301, 2056753, 2223967, 2317927, 2349679, 2413927, 3121201, 3577393, 4148953, 4298443
Offset: 1

Views

Author

K. D. Bajpai, Jun 10 2014

Keywords

Examples

			19 is in the sequence because 2^2 + 2*3 + 3^2 = 19 is prime: 2 and 3 are consecutive primes.
109 is in the sequence because 5^2 + 5*7 + 7^2 = 109 is prime: 5 and 7 are consecutive primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory): A243761:= proc() local k, p, q; p:=ithprime(n); q:=ithprime(n+1); k:=p^2 + p*q + q^2;  if isprime(k) then RETURN (k); fi; end: seq(A243761 (), n=1..500);
  • Mathematica
    Select[Table[Prime[n]^2 + Prime[n] Prime[n + 1] + Prime[n + 1]^2, {n, 500}], PrimeQ[#] &]
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A243761_gen(): # generator of terms
        p, q = 2, 3
        while True:
            if isprime(r:=p*(p+q)+q**2):
                yield r
            p, q = q, nextprime(q)
    A243761_list = list(islice(A243761_gen(),20)) # Chai Wah Wu, Feb 27 2023