OFFSET
0,1
LINKS
FORMULA
G.f.: (3-3*x+x^2+x^3+2*x^4)/((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1)+a(n-4)-a(n-5) for n>4.
a(n) = n+1-2*(-1)^((n+1)*(n+2)*(n+3)/2).
a(n) = n+(-1)^n+2*cos(n*Pi/2). - Wesley Ivan Hurt, May 09 2021
Sum_{n>=0, n!=1} (-1)^n/a(n) = log(2) (A002162). - Amiram Eldar, Dec 25 2023
MATHEMATICA
Table[n + 1 - 2*(-1)^((n + 1)*(n + 2)*(n + 3)/2), {n, 0, 100}] (* or *) CoefficientList[Series[(3 - 3*x + x^2 + x^3 + 2*x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 100}], x]
Flatten[RotateRight/@Partition[Range[0, 100], 4]] (* or *) LinearRecurrence[ {1, 0, 0, 1, -1}, {3, 0, 1, 2, 7}, 100] (* Harvey P. Dale, Jul 01 2019 *)
PROG
(Magma) [n+1-2*(-1)^((n+1)*(n+2)*(n+3) div 2) : n in [0..100]];
(PARI) Vec((3-3*x+x^2+x^3+2*x^4)/((x-1)^2*(1+x+x^2+x^3)) + O(x^100)) \\ Altug Alkan, Oct 19 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 19 2015
STATUS
approved