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.

A236056 Numbers k such that k^2 +- k +- 1 is prime for all four possibilities.

Original entry on oeis.org

3, 6, 21, 456, 1365, 2205, 2451, 2730, 8541, 18486, 32199, 32319, 32781, 45864, 61215, 72555, 72561, 82146, 83259, 86604, 91371, 95199, 125334, 149331, 176889, 182910, 185535, 210846, 225666, 226254, 288420, 343161, 350091, 403941, 411501, 510399, 567204
Offset: 1

Views

Author

Derek Orr, Jan 18 2014

Keywords

Comments

The only prime in this sequence is a(1) = 3.

Examples

			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.
		

Crossrefs

Numbers in the intersection of A002384, A045546, A055494, and A002328.
Numbers in the intersection of A131530 and A088485.

Programs

  • Maple
    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
  • Mathematica
    Select[Range[568000],AllTrue[Flatten[{#^2+#+{1,-1},#^2-#+{1,-1}},1],PrimeQ]&] (* Harvey P. Dale, Jul 31 2022 *)
  • Python
    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)}