%I #23 Jun 15 2018 09:46:04
%S 1,2,8,32,62,70,118,122,158,182,196,566,752,3602,21896,22768,53072
%N Numbers n such that 3^(2*n-1) + 2 is prime.
%C From _Enrique Pérez Herrero_, Jul 29 2010: (Start)
%C With: f(n)=3^(2n-1)+2, the non-primality of f(n) is settled when:
%C if 2 does not divide n, 5 divides f(n) (n>1)
%C if 3 divides n, 7 divides f(n)
%C if 5 divides n-4, 11 divides f(n)
%C if 14 divides n-2, 29 divides f(n)
%C if 15 divides n-5, 31 divides f(n).
%C (End)
%D _Luis H. Gallardo_, Posting to the Number Theory List, Jan 14 2008
%H L. H. Gallardo, <a href="http://dx.doi.org/10.4171/EM/149">On a remark of Makowski about perfect numbers</a>, El. Mathem. 65 (3) (2010) 121-126
%H Henri & Renaud Lifchitz, <a href="http://www.primenumbers.net/prptop/searchform.php?form=3%5En%2B2&action=Search">PRP Records</a>.
%F ({odd terms in A051783} + 1)/2.
%t Contribution from _Enrique Pérez Herrero_, Jul 29 2010: (Start)
%t MaxVal = 1000;
%t dataA134753=Select[Select[Range[MaxVal],#<3||Mod[#,2]==0&&Mod[#,3]!=0&&Mod[#,5]!=4&&Mod[#,14]!=2&&Mod[#,15]!=5&],PrimeQ[3^(2*#-1)+2]&]
%t A134753[n_Integer] := dataA134753[[n]] /; (n > 0 && n <= Length[dataA134753])
%t (End)
%o (PARI) is(n)=isprime(3^(2*n-1)+2) \\ _Charles R Greathouse IV_, Jun 06 2017
%Y Cf. A051783, A134752.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_, Jan 28 2008
%E Typo in prime search corrected _Enrique Pérez Herrero_, Jul 31 2010
%E a(15)-a(17) from A051783 by _Ray Chandler_, Aug 06 2011