OFFSET
1,3
COMMENTS
Complement of A047235. - Reinhard Zumkeller, Oct 01 2008
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
G.f.: x*(1+x+x^2)/((1-x)^2*(1+x^2)) = x*(1-x^2)*(1-x^3)/((1-x)^3*(1-x^4)).
a(n) = n + A004524(n+1) = -a(-n) for all n in Z.
Starting (1, 3, 5, ...) = partial sums of (1, 2, 2, 1, 1, 2, 2, 1, 1, ...). - Gary W. Adamson, Jun 19 2008
A093719(a(n)) = 1. - Reinhard Zumkeller, Oct 01 2008
a(n) = 2*(n-floor(n/4)) - (3-I^n-(-I)^n-(-1)^n)/4, with offset 0..a(0)=0. - Gary Detlefs, Mar 19 2010
a(n) = (3*n-3+cos(Pi*n/2))/2. - R. J. Mathar, Oct 08 2010
From Wesley Ivan Hurt, May 20 2016: (Start)
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4) for n>4.
a(n) = (6*n-6+(-1)^(n/2)+(-1)^(-n/2))/4. (End)
Euler transform of length 4 sequence [3, -1, -1, 1]. - Michael Somos, Jun 24 2017
Sum_{n>=2} (-1)^n/a(n) = log(2)/3 + log(3)/2. - Amiram Eldar, Dec 16 2021
E.g.f.: (2 + 3*exp(x)*(x - 1) + cos(x))/2. - Stefano Spezia, Jul 26 2024
MAPLE
seq(2*(n-floor(n/4)) - (3-I^n-(-I)^n-(-1)^n)/4, n = 0..69); # Gary Detlefs, Mar 19 2010
MATHEMATICA
LinearRecurrence[{2, -2, 2, -1}, {0, 1, 3, 5}, 80] (* Harvey P. Dale, Jan 04 2015 *)
PROG
(PARI) a(n)=n+(n+1)\4+(n+2)\4
(Sage) [(lucas_number1(n+2, 0, 1)+3*n)/2 for n in range(0, 70)] # Zerinvary Lajos, Mar 09 2009
(Haskell)
a047273 n = a047273_list !! (n-1)
a047273_list = 0 : 1 : 3 : 5 : map (+ 6) a047273_list
-- Reinhard Zumkeller, Feb 19 2013
(Magma) [[(6*n-6+(-1)^(n div 2)+(-1)^(-n div 2))/4: n in [1..100]]; // Wesley Ivan Hurt, May 20 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved