OFFSET
0,2
COMMENTS
Primes in this sequence: 3, 7, 11, 13, 19, 23, 31, 37, 43, 47, 59, 61, 67, 71, 73, 79, 83, 97, 103, 107, 109, 127, 131, 139, 151, 157, 163, 167, 179, 181, 191, 193, 199, ... (A040116, offset 2).
LINKS
Carauleanu Marc, Table of n, a(n) for n = 0..4444
Ilya Gutkovskiy, Illustration
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1)
FORMULA
O.g.f.: (1 + x + 3*x^2 + x^3)/((1 - x)^2*(1 + x^2)).
E.g.f.: (1 + 3*x)*exp(x) - sin(x).
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4).
a(n) = 3*n - sin(Pi*n/2) + 1.
a(n) = (6*n - i*((-i)^n - i^n + 2*i))/2, where i is the imaginary unit.
MAPLE
a:=series((1+x+3*x^2+x^3)/((1-x)^2*(1+x^2)), x=0, 71): seq(coeff(a, x, n), n=0..70); # Paolo P. Lava, Mar 27 2019
MATHEMATICA
LinearRecurrence[{2, -2, 2, -1}, {1, 3, 7, 11}, 71]
Table[3 n - Sin[Pi (n/2)] + 1, {n, 0, 70}]
Table[(6 n - I ((-I)^n - I^n + 2 I))/2, {n, 0, 70}]
PROG
(PARI) Vec((1+x+3*x^2+x^3)/((1-x)^2*(1+x^2)) + O(x^99)) \\ Altug Alkan, Aug 27 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Aug 27 2016
STATUS
approved