login
Numbers n such that 9*n^2+3*n-1 and 9*n^2+3*n+1 are twin primes.
1

%I #15 Feb 10 2019 19:39:26

%S 1,2,5,7,8,18,22,46,47,51,77,82,96,103,117,126,135,151,152,165,208,

%T 240,266,275,305,327,366,383,400,420,436,455,460,498,516,522,530,553,

%U 582,596,602,616,712,735,791,803,817,852,876,882,883,910,912,966,975

%N Numbers n such that 9*n^2+3*n-1 and 9*n^2+3*n+1 are twin primes.

%H Pierre CAMI, <a href="/A238364/b238364.txt">Table of n, a(n) for n = 1..10000</a>

%e 1*1*9+1*3-1=11; 11 and 13 are twin primes so a(1)=1.

%e 2*2*9+2*3-1=41; 41 and 43 are twin primes so a(2)=2.

%t Select[Range[1000],AllTrue[9#^2+3#+{1,-1},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Feb 10 2019 *)

%o (PARI) s=[]; for(n=1, 1000, if(isprime(9*n^2+3*n-1) && isprime(9*n^2+3*n+1), s=concat(s, n))); s \\ _Colin Barker_, Feb 26 2014

%Y Cf. A001097.

%K nonn,easy

%O 1,2

%A _Pierre CAMI_, Feb 25 2014