%I #45 Aug 11 2024 14:41:29
%S 2,3,5,7,9,13,15,19,21,27,29,33,35,37,43,47,49,55,61,63,69,71,75,77,
%T 89,93,103,107,117,119,121,127,131,135,139,145,155,161,169,173,177,
%U 183,191,205,211,217,223,231,233,237,239,247,253,257,259,265,267,273,279,285
%N Numbers k such that k^2 - 2 is prime.
%C It is conjectured that this sequence is infinite.
%C Primes 2,3,5,7,13,... are in A062326. - _Zak Seidov_, Oct 05 2014
%D D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, p. 31.
%H Nathaniel Johnston, <a href="/A028870/b028870.txt">Table of n, a(n) for n = 1..10000</a>
%H P. De Geest, <a href="https://www.worldofnumbers.com/consemor.htm">Palindromic Quasipronics of the form n(n+x)</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Near-SquarePrime.html">Near-Square Prime</a>
%F a(n) = sqrt(2 + A028871(n)). - _Zak Seidov_, Oct 05 2014
%e 5^2 - 2 = 23 is prime, so 5 is in the sequence.
%p select(k->isprime(k^2-2),[$1..300]); # _Muniru A Asiru_, Jul 15 2018
%t a[n_]:=n^x-y;lst={};x=2;y=2;Do[If[PrimeQ[a[n]],AppendTo[lst,n]],{n,0,6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Jan 03 2009 *)
%t Select[Range[300],PrimeQ[#^2-2]&] (* _Harvey P. Dale_, Mar 21 2013 *)
%o (Magma) [n: n in [1..1000] |IsPrime( n^2 - 2)]; // _Vincenzo Librandi_, Nov 18 2010
%o (PARI) is(n)=isprime(n^2-2) \\ _Charles R Greathouse IV_, Jul 01 2013
%Y Cf. A028871.
%K nonn,easy
%O 1,1
%A _Patrick De Geest_