login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers n such that 30*n^2 - 1 and 30*n^2 + 1 are (twin) primes.
2

%I #23 Sep 08 2022 08:46:19

%S 1,3,10,14,18,38,62,73,116,118,143,183,221,232,242,330,333,413,430,

%T 455,470,496,507,533,538,556,606,622,645,675,687,701,720,777,792,819,

%U 846,879,881,895,913,1000,1019,1030,1092,1155,1214,1238,1253,1261,1313,1337,1350,1407,1418,1429,1431

%N Numbers n such that 30*n^2 - 1 and 30*n^2 + 1 are (twin) primes.

%H Charles R Greathouse IV, <a href="/A283867/b283867.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) >> n log^2 n. - _Charles R Greathouse IV_, Mar 17 2017

%e 3 is in this sequence because 30*3^2 - 1 = 269 and 30*3^2 + 1 = 271 are twin primes.

%t Select[Range@ 1431, PrimeQ[30*#^2 + 1] && PrimeQ[30*#^2 - 1] &] (* _Indranil Ghosh_, Mar 17 2017 *)

%o (Magma) [n: n in [1..1500] | IsPrime(30*n^2-1) and IsPrime(30*n^2+1)];

%o (PARI) is(n)=isprime(30*n^2-1) && isprime(30*n^2+1) \\ _Charles R Greathouse IV_, Mar 17 2017

%o (Python)

%o from sympy import isprime

%o [i for i in range(1, 1501) if isprime(30*i**2 - 1) and isprime(30*i**2 + 1)] # _Indranil Ghosh_, Mar 17 2017

%Y Cf. A000290, A001097, A077800, A158558, A158560.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Mar 17 2017