login
Numbers k such that exactly one of prime(k)^2 - 2 and prime(k)^2 + 2 is prime.
0

%I #8 Jan 23 2019 02:32:21

%S 1,3,4,6,8,10,12,14,15,18,20,24,27,28,31,32,34,40,43,47,48,51,52,55,

%T 62,65,68,72,82,86,87,91,94,99,100,104,107,111,119,123,128,129,130,

%U 132,133,134,135,139,141,150,152,170,172,177,180,182,191,200,202,209,211,214

%N Numbers k such that exactly one of prime(k)^2 - 2 and prime(k)^2 + 2 is prime.

%C Essentially the same as A137291.

%e a(1)=1 because prime(1)^2 - 2 = 2 is prime and prime(1)^2 + 2 = 6 is composite.

%p isA173472 := proc(n) local p,pplus,pmin ; p := ithprime(n) ; pmin := isprime(p^2-2) ; pplus := isprime(p^2+2) ; if pmin <> pplus then return true; else return false; end if; end proc: for n from 1 to 300 do if isA173472(n) then printf("%d,",n) ; end if; end do ; # _R. J. Mathar_, Feb 21 2010

%Y Cf. A137291.

%K nonn,less

%O 1,2

%A _Juri-Stepan Gerasimov_, Feb 19 2010

%E More terms from _R. J. Mathar_, Feb 21 2010

%E Edited by _Charles R Greathouse IV_, Mar 24 2010