OFFSET
1,1
COMMENTS
The computations were done without any assumptions on the form of d.
Numbers k such that k+3 and 2k+3 are both primes.
Equivalently, integers d such that the largest possible arithmetic progression (AP) of primes with common difference d has exactly 3 elements (see example). These 3 elements are not necessarily consecutive primes. In fact, for each term d, there exists only one such AP of primes, and this one starts always with A342309(d) = 3, so this AP is (3, 3+d, 3+2d). - Bernard Schott, Jan 15 2023
LINKS
Sameen Ahmed Khan, Table of n, a(n) for n = 1..10000.
Diophante, A1880. NP en PA (prime numbers in arithmetic progression) (in French).
Sameen A. Khan, Primes in Geometric-Arithmetic Progression, arXiv preprint arXiv:1203.2083 [math.NT], 2012.
Wikipedia, Primes in arithmetic progression.
FORMULA
a(n) = 2 * A115334(n). - Wesley Ivan Hurt, Feb 06 2014
m is a term iff A123556(m) = 3. - Bernard Schott, Jan 15 2023
EXAMPLE
d = 8 then {3, 3 + 1*8, 3 + 2*8} = {3, 11, 19}, which is 3 primes in arithmetic progression.
MAPLE
filter := d -> isprime(3+d) and isprime(3+2*d) : select(filter, [$(1 .. 650)]); # Bernard Schott, Jan 16 2023
MATHEMATICA
t={}; Do[If[PrimeQ[{3, 3 + d, 3 + 2*d}] == {True, True, True}, AppendTo[t, d]], {d, 1000}]; t
Select[Range[2, 700, 2], And@@PrimeQ[{3+#, 3+2#}]&] (* Harvey P. Dale, Sep 25 2013 *)
PROG
(TI-Basic) Clrio:Input "n", n:Lbl colorin:If isPrime(n+3) and isPrime(2*n+3) Then:Disp n:Pause:Endif:n+1(sto)n:Goto colorin:EndPrgm " César Aguilera, Dec 27 2015
(PARI) for(n=1, 1e3, if(isprime(n + 3) && isprime(2*n + 3), print1(n, ", "))); \\ Altug Alkan, Dec 27 2015
(Magma) [n: n in [1..700] | IsPrime(3+n) and IsPrime(3+2*n)]; // Vincenzo Librandi, Dec 28 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Sameen Ahmed Khan, Feb 03 2012
STATUS
approved