login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A110659
a(n) = A028242(A110654(n)).
2
1, 0, 0, 2, 2, 1, 1, 3, 3, 2, 2, 4, 4, 3, 3, 5, 5, 4, 4, 6, 6, 5, 5, 7, 7, 6, 6, 8, 8, 7, 7, 9, 9, 8, 8, 10, 10, 9, 9, 11, 11, 10, 10, 12, 12, 11, 11, 13, 13, 12, 12, 14, 14, 13, 13, 15, 15, 14, 14, 16, 16, 15, 15, 17, 17, 16, 16, 18, 18, 17, 17, 19, 19, 18, 18, 20, 20, 19, 19, 21, 21, 20
OFFSET
0,4
FORMULA
a(n) = floor(n/4) - (n mod 4) mod 3 + floor((2 + n mod 4)/2).
a(n) = (2*n + 3 + 6*cos(n*Pi/2) - cos(n*Pi) - 6*sin(n*Pi/2))/8. - Wesley Ivan Hurt, Oct 01 2017
a(n + 4) = a(n) + 1 so a(n + 8) = 2 * a(n + 4) - a(n). - David A. Corneth, Oct 02 2017
G.f.: (1 + 2*x^3 - x - x^4)/((1 + x)*(1 - x)^2*(1 + x^2)). - R. J. Mathar, May 22 2019
E.g.f.: (3*cos(x) + cosh(x)*(1 + x) - 3*sin(x) + (2 + x)*sinh(x))/4. - Stefano Spezia, Jan 03 2023
MATHEMATICA
A028242[n_] := (1 + 2*n + 3*(-1)^n)/4; Table[A028242[Ceiling[n/2]], {n, 0, 100}] (* G. C. Greubel, Sep 03 2017 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {1, 0, 0, 2, 2}, 100] (* Harvey P. Dale, Jul 05 2020 *)
PROG
(PARI) vector(100, n, n--; (1/4)*(1 + 2*ceil(n/2) + 3*(-1)^(ceil(n/2)))) \\ G. C. Greubel, Sep 03 2017
(PARI) a(n) = (n\4) + [1, 0, 0, 2][1+n%4] \\ David A. Corneth, Oct 02 2017
(PARI) first(n) = my(c = res = [1, 0, 0, 2]); for(i=1, (n-1)\4, c += [1, 1, 1, 1]; res = concat(res, c)); res \\ David A. Corneth, Oct 02 2017
(Magma) b:= func< n | (1 + 2*n + 3*(-1)^n)/4 >; [b(Ceiling(n/2)): n in [0..100]]; // G. C. Greubel, May 22 2019
(Sage) ((1+2*x^3-x-x^4)/((1-x)*(1-x^4))).series(x, 100).coefficients(x, sparse=False) # G. C. Greubel, May 22 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Aug 05 2005
STATUS
approved