OFFSET
0,5
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 0, 1, -1).
FORMULA
a(0)=0. a(1)=a(2)=1. a(3*n)=A005408(n-1). a(3*n+1)=a(3*n)+1. a(3*n+2)=a(3*n)+2, n>0.
O.g.f.: x*(1+x^4)/((1-x)^2*(x^2+x+1)). a(n)=(2*n-2-A057078(n))/3, n>1. - R. J. Mathar, Jul 16 2008
Euler transform of length 8 sequence [ 1, 0, 1, 1, 0, 0, 0, -1]. - Michael Somos, Jan 11 2011
0 = a(n) - a(n+1) - a(n+3) + a(n+4) if n>1. - Michael Somos, Nov 11 2015
a(n) = floor((2*n-1)/3) for n > 1. - Werner Schulte, Feb 27 2019
EXAMPLE
G.f. = x + x^2 + x^3 + 2*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 5*x^8 + 5*x^9 + 6*x^10 + ...
MAPLE
A131737 := proc(n): (1/9)*add(5*(k mod 3)+2*((k+1) mod 3)-((k+2) mod 3), k=0..n)-1+(binomial(2*n, n) mod 2)+(binomial((n+1)^2, n+3) mod 2) end: seq( A131737(n), n=0..74); # Johannes W. Meijer, Jun 27 2011
MATHEMATICA
Join[{0, 1}, LinearRecurrence[{1, 0, 1, -1}, {1, 1, 2, 3}, 68]] (* Georg Fischer, Feb 27 2019 *)
Insert[Flatten[Table[If[EvenQ[n], n, {n, n}], {n, 0, 70}]], 1, 2] (* Harvey P. Dale, Sep 04 2020 *)
PROG
(PARI) {a(n) = (n==0) + (n==1) + (n\3)*2 + (n%3) - 1}; /* Michael Somos, Jan 11 2011 */
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Paul Curtz, Sep 19 2007
EXTENSIONS
Edited by R. J. Mathar, Jul 16 2008
STATUS
approved