OFFSET
1,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
From R. J. Mathar, Oct 08 2011: (Start)
G.f.: x^2*(2+x^2) / ( (1+x^2)*(1-x)^2 ).
a(n) = 3*n/2 - 1 - sin(Pi*n/2)/2. (End)
From Wesley Ivan Hurt, May 21 2016: (Start)
a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n > 4.
a(n) = (6*n - 4 - i^(1-n) + i^(1+n))/4, where i = sqrt(-1).
From Guenther Schrack, Feb 14 2019: (Start)
a(n) = (6*n - 4 - (1 - (-1)^n)*(-1)^(n*(n-1)/2))/4.
a(n) = a(n-4) + 6, a(1)=0, a(2)=2, a(3)=4, a(4)=5, for n > 4. (End)
Sum_{n>=2} (-1)^n/a(n) = log(3)/4 + log(2)/3 - sqrt(3)*Pi/36. - Amiram Eldar, Dec 17 2021
MAPLE
MATHEMATICA
Select[Range[0, 100], MemberQ[{0, 2, 4, 5}, Mod[#, 6]]&] (* or *) LinearRecurrence[{2, -2, 2, -1}, {0, 2, 4, 5}, 70] (* Harvey P. Dale, Dec 09 2015 *)
PROG
(Magma) [n : n in [0..100] | n mod 6 in [0, 2, 4, 5]]; // Wesley Ivan Hurt, May 21 2016
(PARI) my(x='x+O('x^70)); concat([0], Vec(x^2*(2+x^2)/((1+x^2)*(1-x)^2))) \\ G. C. Greubel, Feb 16 2019
(Sage) a=(x^2*(2+x^2)/((1+x^2)*(1-x)^2)).series(x, 72).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Feb 16 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Wesley Ivan Hurt, May 21 2016
STATUS
approved