login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A161866
Numbers k such that k^2+k+7 and k^2+k-7 are both prime.
1
3, 5, 9, 12, 24, 29, 32, 39, 44, 50, 57, 59, 65, 102, 135, 137, 144, 170, 180, 207, 260, 267, 297, 302, 305, 344, 347, 360, 365, 369, 389, 404, 429, 464, 474, 495, 540, 555, 570, 612, 620, 659, 662, 689, 767, 774, 792, 824, 837, 872, 885, 900, 950, 954, 989
OFFSET
1,1
LINKS
EXAMPLE
a(1)=3 as 12+-7 are primes. a(2)=5 as 30+-7 are primes.
MATHEMATICA
q=7; lst7={}; Do[p=n^2+n; If[PrimeQ[p-q]&&PrimeQ[p+q], AppendTo[lst7, n]], {n, 0, 7!}]; lst7
Select[Range[1000], AllTrue[#^2+#+{7, -7}, PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 26 2021 *)
PROG
(Magma) [k:k in [1..1000]| IsPrime(k^2+k+7) and IsPrime(k^2+k-7)]; // Marius A. Burtea, Feb 17 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Definition rephrased by R. J. Mathar, Jun 23 2009
STATUS
approved