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.

A352604 Primes p such that p^2+3*p+1 and p^2+p-1 are also prime.

Original entry on oeis.org

2, 3, 5, 19, 53, 59, 163, 263, 349, 373, 419, 449, 499, 1013, 1093, 1259, 1303, 1423, 1489, 1493, 1669, 1759, 2069, 2729, 2879, 3463, 3943, 4159, 4243, 4283, 4493, 4603, 4793, 4969, 5113, 5303, 5563, 6323, 6599, 6803, 6829, 6883, 7369, 7523, 7529, 7963, 8039, 8713, 8969, 9043, 9173, 9293, 9623
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Mar 22 2022

Keywords

Comments

Primes p such that (p-1)*p+(p-1)+p and p*(p+1)+p+(p+1) are also prime.

Examples

			a(3) = 5 is a term because 5, 5^2+3*5+1 = 41 and 5^2+5-1 = 29 are all prime.
		

Crossrefs

Intersection of A053184 and A153590.

Programs

  • Maple
    select(t -> isprime(t^2+3*t+1) and isprime(t^2+t-1), [seq(ithprime(i),i=1..10000)]);
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen():
        p = 2
        while True:
            if isprime(p**2 + 3*p + 1) and isprime(p**2 + p - 1):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 53))) # Michael S. Branicky, Mar 22 2022