OFFSET
0,1
COMMENTS
a(n) are distinct primes for n = 0 to 59.
All terms are in A202018.
LINKS
Arkadiusz Wesolowski, Table of n, a(n) for n = 0..1000
Carlos Rivera, Puzzle 782
Eric Weisstein's World of Mathematics, Prime-Generating Polynomial
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
G.f.: (1447-2*x*(37+1552*x-41*x^2)+(41*x^2)^2)/((1+x)^2*(1-x)^3).
From Colin Barker, Aug 14 2017: (Start)
G.f.: (1447 - 74*x - 3104*x^2 + 82*x^3 + 1681*x^4) / ((1 - x)^3*(1 + x)^2).
a(n) = 4*n^2 - 150*n + 1447 for n even.
a(n) = 4*n^2 - 154*n + 1523 for n odd.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
(End)
MATHEMATICA
g[n_] := 2*n - 38; f[n_] := ((-1)^n + g[n])*g[n] + 41; Table[f[n], {n, 0, 50}]
EulerP[n_] := n^2 - n + 41; f[n_] := 2*n - (3 + (-1)^n)/2; LinearRecurrence[{1, 2, -2, -1, 1}, Table[EulerP@f[n], {n, 19, 15, -1}], {0, 50}]
PROG
(Magma) [((-1)^n+a)*a+41 where a is 2*n-38 : n in [0..50]]
(PARI) Vec((1447 - 74*x - 3104*x^2 + 82*x^3 + 1681*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^100)) \\ Colin Barker, Aug 14 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Arkadiusz Wesolowski, May 26 2013
STATUS
approved