OFFSET
0,3
COMMENTS
Also defined by: a(0)=1; thereafter, a(n) = number of copies of a(n-1) in the list [a(0), a(1), ..., a(n-1)]. - N. J. A. Sloane, Feb 12 2016
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) = Sum_{k=0..floor(n/2)} binomial(k+1,n-k).
G.f.: Q(0)/x - 1/x, where Q(k)= 1 + (k+1)*x/(1 - x/(x + (k+1)/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 23 2013
E.g.f.: cosh(x) + (2 + x)*sinh(x)/2. - Stefano Spezia, Sep 06 2023
MATHEMATICA
CoefficientList[Series[(1+x-x^3)/(1-x^2)^2, {x, 0, 100}], x] (* or *) LinearRecurrence[{0, 2, 0, -1}, {1, 1, 2, 1}, 100] (* Harvey P. Dale, Aug 17 2016 *)
PROG
(PARI) a(n)=1+!(n%2)*n/2 \\ Jaume Oliver Lafont, Mar 21 2009
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Mar 18 2009
STATUS
approved