login
Least j such that j*n^2 -1 and j*n^2 +1 are twin primes.
2

%I #18 Sep 17 2019 10:31:26

%S 4,1,2,12,6,2,18,3,10,6,12,3,12,18,18,57,12,5,120,12,2,3,132,2,42,3,

%T 58,45,12,7,72,15,10,3,6,2,60,30,12,3,168,2,192,18,2,33,48,10,138,39,

%U 8,63,42,22,60,42,32,3,120,6,90,18,40,165,204,7,90,18,70,6,72,27,30,15,6,18

%N Least j such that j*n^2 -1 and j*n^2 +1 are twin primes.

%C Define Sj=sum of j(n) for n=1 to N. Define Sn=sum of (2*log(n))^2 for n=1 to N. As N increases Sj/Sn tends to 0.6. - _Pierre CAMI_, Dec 13 2011

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

%e 12*4*4-1=191, 191 and 193 are twin primes so a(4)=12.

%o (PARI) a(n) = my(j=1); while (!(isprime(p=j*n^2-1) && isprime(p+2)), j++); j; \\ _Michel Marcus_, Sep 17 2019

%Y Cf. A231819.

%K nonn

%O 1,1

%A _Pierre CAMI_, Sep 12 2005

%E Extended by _Ray Chandler_, Sep 15 2005