OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-6,10,-12,12,-10,6,-3,1).
FORMULA
a(n) = n*(n+3)/2 * (2 - floor((n+1)/2) mod 2), where n*(n+3)/2 is A000096(n).
a(n) = (2*n*(n+3))/(GCD(4, n+2)*GCD(4, n+3)).
a(n) = A227316(n+1) - (period 4 repeat 2,1,1,2).
From Colin Barker, Jun 21 2017: (Start)
G.f.: x*(2 - x + 15*x^2 - 16*x^3 + 18*x^4 - 9*x^5 + 5*x^6 - 2*x^7) / ((1 - x)^3*(1 + x^2)^3).
a(n) = (1/8 + i/8)*(((3 - 3*i) - i*(-i)^n + i^n)*n*(3 + n)), where i=sqrt(-1). (End)
Sum_{n>=1} 1/a(n) = 17/18 + log(2)/6. - Amiram Eldar, Aug 12 2022
MATHEMATICA
a[n_] := n (n+3) Switch[Mod[n, 4], 0|3, 1, _, 1/2]; Table[a[n], {n, 0, 50}]
Table[If[MemberQ[{0, 3}, Mod[n, 4]], n(n+3), (n(n+3))/2], {n, 0, 50}] (* or *) LinearRecurrence[{3, -6, 10, -12, 12, -10, 6, -3, 1}, {0, 2, 5, 18, 28, 20, 27, 70, 88}, 60] (* Harvey P. Dale, Jun 05 2021 *)
PROG
(PARI) concat(0, Vec(x*(2 - x + 15*x^2 - 16*x^3 + 18*x^4 - 9*x^5 + 5*x^6 - 2*x^7) / ((1 - x)^3*(1 + x^2)^3) + O(x^60))) \\ Colin Barker, Jun 21 2017
(PARI) i=I; a(n) = (1/8 + i/8)*(((3 - 3*i) - i*(-i)^n + i^n)*n*(3 + n)) \\ Colin Barker, Jun 21 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jean-François Alcover and Paul Curtz, Jun 21 2017
STATUS
approved