OFFSET
0,5
LINKS
Felix Fröhlich, Table of n, a(n) for n = 0..10000
Han Wang and Zhi-Wei Sun, Evaluations of three determinants, arXiv:2206.12317 [math.NT], 2022.
Index entries for linear recurrences with constant coefficients, signature (1,-2,2,-1,1).
FORMULA
G.f.: (1-x+x^2+x^4)/((1-x)*(1+x^2)^2).
a(n) = (1/2)*(1 + cos((n+1)*Pi/2) + (n+1)*sin((n+1)*Pi/2)). - Harvey P. Dale, Nov 21 2014; corrected by Bernard Schott, Jun 27 2022
For n >= 0: a(4n) = 2n+1; a(4n+1) = 0; a(4n+2) = -a(4n) = -2n-1; a(4n+3) = 1. - Bernard Schott, Jun 27 2022
a(n) - a(n-1) = A127365(n+1). - R. J. Mathar, Jul 01 2024
E.g.f.: (exp(x) + cos(x) - (1 + x)*sin(x))/2. - Stefano Spezia, Jul 14 2024
a(n) = (1/2)*(1 - A056594(n) - A056594(n-1) + 2*(-1)^floor(n/2) * A027656(n)). - G. C. Greubel, Jul 27 2024
MATHEMATICA
LinearRecurrence[{1, -2, 2, -1, 1}, {1, 0, -1, 1, 3}, 80] (* Harvey P. Dale, Nov 21 2014 *)
PROG
(PARI) Vec((1-x+x^2+x^4)/((1-x)*(1+x^2)^2) + O(x^80)) \\ Felix Fröhlich, Jun 28 2022
(Magma)
R<x>:=PowerSeriesRing(Integers(), 80);
Coefficients(R!( (1-x+x^2+x^4)/((1-x)*(1+x^2)^2) )); // G. C. Greubel, Jul 27 2024
(SageMath)
def A166445_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( (1-x+x^2+x^4)/((1-x)*(1+x^2)^2) ).list()
A166445_list(80) # G. C. Greubel, Jul 27 2024
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Oct 13 2009
STATUS
approved