%I #38 Sep 26 2023 09:54:31
%S 31,43,67,103,151,211,283,367,463,571,691,823,967,1123,1291,1471,1663,
%T 1867,2083,2311,2551,2803,3067,3343,3631,3931,4243,4567,4903,5251,
%U 5611,5983,6367,6763,7171,7591,8023,8467,8923,9391,9871,10363,10867,11383
%N a(n) = 6*n^2 + 6*n + 31.
%C First 29 values are primes.
%C From _Peter Bala_, Apr 18 2018: (Start)
%C Let P(n) = 6*n^2 + 6*n + 31. The polynomial P(2*n-14) = 24*n^2 - 660*n + 4567 takes distinct prime values for n = 0 to 28.
%C The value of the polynomial 2*P(3/2*(n-10)) = 27*n^2 - 522*n + 2582 for n = 0 to 22 is either double a prime or a prime (alternately).
%C The value of the polynomial 4*P(4/3*(n-9)) = 32*n^2 - 552*n + 2469 for n = 0 to 28 is either prime or 3 times a prime, except when n = 16. (End)
%C Also, numbers k such that 2*k/3 - 2/3 - 19 is a perfect square. - _Bruno Berselli_, Apr 23 2018
%C Equivalently, numbers k such that 6*k - 177 is a square. - _Vincenzo Librandi_, Apr 23 2018
%D Donald D. Spencer, Computers in Number Theory, Computer Science Press, Rockville, MD, 1982, pp. 118-119.
%H Harry J. Smith, <a href="/A060834/b060834.txt">Table of n, a(n) for n = 0..1000</a>
%H T. Piezas, <a href="https://sites.google.com/view/tpiezas/0023-part-2-prime-generating-polynomials">A collection of algebraic identities. 0023: Part 2, Prime Generating Polynomials, Section IV</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Prime-GeneratingPolynomial.html">Prime-Generating Polynomial</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3, -3, 1).
%F From _R. J. Mathar_, Feb 05 2008: (Start)
%F O.g.f.: -(31-50*x+31*x^2)/(-1+x)^3.
%F a(n) = A049598(n)+31. (End)
%F a(0)=31, a(1)=43, a(2)=67, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - _Harvey P. Dale_, Aug 09 2011
%e a(29)=4903, prime. a(30)=5251, nonprime.
%t Table[6n^2+6n+31,{n,0,60}] (* or *) LinearRecurrence[{3,-3,1},{31,43,67},60] (* _Harvey P. Dale_, Aug 09 2011 *)
%o (PARI) { for (n=0, 1000, write("b060834.txt", n, " ", 6*n^2 + 6*n + 31); ) } \\ _Harry J. Smith_, Jul 19 2009
%o (GAP) List([0..80],n->6*n^2+6*n+31); # _Muniru A Asiru_, Apr 22 2018
%Y Cf. A049598, A060844, A005846.
%K nonn,easy
%O 0,1
%A _Jason Earls_, May 02 2001
%E More terms from Larry Reeves (larryr(AT)acm.org), May 07 2001