|
|
|
|
1, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(n-2) for n > 3, with a(0) = 1, a(1) = 2, a(2) = 2, a(3) = 3.
a(n) = (5 - (-1)^n)/2 for n > 1, with a(0) = 1, a(1) = 2.
a(n) = (n+1)*[n<2] + A010693(n)*[n>1].
G.f.: (1_+ 2*x + x^2 + x^3)/(1 - x^2).
E.g.f.: (1/2)*( -exp(-x) - 2*(1+x) + 5*exp(x) ). (End)
|
|
MATHEMATICA
|
Table[If[n<2, n+1, (5-(-1)^n)/2], {n, 0, 110}] (* G. C. Greubel, Nov 25 2021 *)
|
|
PROG
|
(Magma) [n lt 2 select (n+1) else 2 + (n mod 2): n in [0..110]]; // G. C. Greubel, Nov 25 2021
(Sage) [1, 2]+[(5-(-1)^n)/2 for n in (2..110)] # G. C. Greubel, Nov 25 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|