OFFSET
1,4
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
"TwoPi", A Cool Sequence Problem
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
a(n) = ceiling(n/4) if n is odd, n/2 if n is even.
From R. J. Mathar, Jun 19 2010: (Start)
a(n) = a(n-2) + a(n-4) - a(n-6).
G.f.: x*(1+x+x^3) / ( (1+x^2)*(x-1)^2*(1+x)^2 ). (End)
a(n) = (3n+1-2(-1)^((n+3+(1-n)(-1)^n)/4)+(n-3)(-1)^n)/8. - Wesley Ivan Hurt, Mar 19 2015
MATHEMATICA
CoefficientList[Series[x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2), {x, 0, 90}], x] (* G. C. Greubel, Jan 23 2019 *)
PROG
(Haskell)
import Data.List (transpose)
a178804 n = a178804_list !! (n-1)
a178804_list = concat $ transpose [a008619_list, a000027_list]
-- Reinhard Zumkeller, Nov 15 2014
(PARI) my(x='x+O('x^90)); Vec(x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2)) \\ G. C. Greubel, Jan 23 2019
(Magma) m:=90; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!( x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2) )); // G. C. Greubel, Jan 23 2019
(Sage) a=(x*(1+x+x^3)/((1+x^2)*(x-1)^2*(1+x)^2)).series(x, 90).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Jan 23 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Mark McKinzie (mmckinzie(AT)sjfc.edu), Jun 15 2010
STATUS
approved