OFFSET
0,2
COMMENTS
A permutation of the nonnegative numbers.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
a(n+4) = a(n) + (sequence of period 2: repeat 3, 6).
a(4n+1) = 2*a(4n).
a(n) = 3*a(n-4) - 3*a(n-8) + a(n-12).
G.f.: (1 + 2*x - x^2 + 3*x^3 + 3*x^4 + x^5)/(1 - x^2 - x^4 + x^6).
a(n) = (1 + 9*n - 3*(n+1)*(-1)^n + 10*cos(n*Pi/2))/8. - Robert Israel, Dec 03 2014
MATHEMATICA
a[n_] := (1/8)*(3*(-1)^(n+1)*(n+1)+9*n+10*{1, 0, -1, 0}[[Mod[n, 4]+1]]+1); Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 04 2014, after Robert Israel *)
PROG
(PARI) x='x+O('x^75); Vec((1 + 2*x - x^2 + 3*x^3 + 3*x^4 + x^5)/(1 - x^2 - x^4 + x^6)) \\ G. C. Greubel, Sep 20 2018
(Magma) m:=75; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + 2*x - x^2 + 3*x^3 + 3*x^4 + x^5)/(1 - x^2 - x^4 + x^6))); // G. C. Greubel, Sep 20 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Dec 03 2014
STATUS
approved