OFFSET
0,3
COMMENTS
Conjecture: number of roots of P(x) = x^n - x^(n-1) - x^(n-2) -... - x - 1 in the left half-plane. -Michel Lagneau,Apr 09 2013
a(n) is n+2 with its second least significant bit removed (seeA021913(n+2) for that bit). -Kevin Ryde,Dec 13 2019
LINKS
Altug Alkan,Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients,signature (1,0,0,1,-1).
FORMULA
a(n) =A083220(n)/2.
a(n) = a(n-1) + n mod 2 + (n mod 4 - 1)*(1 - n mod 2), a(0) = 0.
G.f.: x*(1+x+x^2-x^3)/((1-x)^2*(1+x)*(1+x^2)). -R. J. Mathar,Aug 28 2008
a(n) = n -A129756(n). -Michel Lagneau,Apr 09 2013
Bisection: a(2*k) = 2*floor((n+2)/4), a(2*k+1) = a(2*k) + 1, k >= 0. -Wolfdieter Lang,May 08 2017
a(n) = (2*n + 3 - 2*cos(n*Pi/2) - cos(n*Pi) - 2*sin(n*Pi/2))/4. -Wesley Ivan Hurt,Oct 02 2017
E.g.f.: ((1 + x)*cosh(x) - cos(x) + (2 + x)*sinh(x) - sin(x))/2. -Stefano Spezia,May 27 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) - 1. -Amiram Eldar,Aug 21 2023
MAPLE
a:= n-> n - 2*floor(n/4):
seq(a(n), n=0..74); #Alois P. Heinz,Jan 24 2021
MATHEMATICA
Array[# - 2 Floor[#/4] &, 75, 0] (*Michael De Vlieger,Oct 02 2017 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 2, 3, 2}, 80] (*Harvey P. Dale,Oct 01 2018 *)
PROG
(PARI) a(n) = n - n\4*2 \\Charles R Greathouse IV,Jun 11 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller,Apr 22 2003
STATUS
approved