OFFSET
0,3
COMMENTS
This sequence does not include the numbers of the type 3*A047202(n)+2.
a(n) = n + floor(n/4)*(-1)^(n mod 2). - Chai Wah Wu, Jan 29 2023
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
G.f.: x*(1 + 2*x + 2*x^2 + 3*x^3)/((1 + x^2)*(1 - x^2)^2).
a(n) = a(n-2) + a(n-4) - a(n-6) for n>5.
a(n+1) + a(n) = A047624(n+1).
a(4*k+r) = (4+(-1)^r)*k + r mod 3, where r = 0..3.
MATHEMATICA
Table[n + Floor[n/4] (-1)^Mod[n, 4], {n, 0, 70}]
LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 1, 2, 3, 5, 4}, 80]
PROG
(Sage) [n+floor(n/4)*(-1)^mod(n, 4) for n in (0..70)]
(Magma) [n+Floor(n/4)*(-1)^(n mod 4): n in [0..70]];
(PARI) x='x+O('x^100); concat(0, Vec(x*(1+2*x+2*x^2+3*x^3)/((1+x^2)*(1- x^2)^2))) \\ Altug Alkan, Dec 22 2015
(Python)
def A265888(n): return n+(-(n>>2) if n&1 else n>>2) # Chai Wah Wu, Jan 29 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Dec 18 2015
STATUS
approved