OFFSET
1,1
COMMENTS
Includes every prime and twin prime (as pairs p, p+2) > 7.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 1, -1).
FORMULA
a(n) = -floor((n mod 2)/2 - 5*n/3) + 9.
a(n) = ceiling(5*n/3 - 3/5*(n mod 2)) + 9.
G.f.: (-9*x^6 + 2*x^5 + x^4 + 2*x^3 + x^2 + 2*x + 11)/(x^7 - x^6 - x + 1).
MATHEMATICA
LinearRecurrence[{1, 0, 0, 0, 0, 1, -1}, {11, 13, 14, 16, 17, 19, 21}, 10^3] (* or *)
Table[Floor[3*n/2] + Ceiling[n/6] + 9, {n, 1000}] (* or *)
CoefficientList[Series[(-9*x^6 + 2*x^5 + x^4 + 2*x^3 + x^2 + 2*x + 11)/(x^7 - x^6 - x + 1), {x, 0, 999}], x]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Mikk Heidemaa, Jan 08 2019
STATUS
approved