OFFSET
0,2
COMMENTS
A permutation of A047253, numbers that are not divisible by 6.
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1,1,1,1,1).
FORMULA
a(n) = 2*a(n-4) - a(n-8).
a(2*n) + a(1+2*n) = -A109613(n)*(-1)^n.
a(3*n) + a(1+3*n) + a(2+3*n) = 3*a(n).
a(4*n) + a(1+4*n) + a(2+4*n) + a(3+4*n) = 0.
a(5*n) + a(1+5*n) + a(2+5*n) + a(3+5*n) + a(4+5*n) = 5*a(n).
From Bruno Berselli, Sep 07 2012: (Start)
G.f.: (1-x+3*x^2+3*x^4-x^5+x^6)/((1-x)*(1+x+x^2+x^3)^2).
a(n) = 1+(5-i^(n*(n+1)))*((2*n+1)*(-1)^n-1)/8, where i=sqrt(-1).
a(2*n) = 1+(5-(-1)^n)*n/2; a(2*n+1) = 1-(5+(-1)^n)*(n+1)/2.
a(n) = a(-n-1) = -a(n-1)-a(n-2)-a(n-3)+a(n-4)+a(n-5)+a(n-6)+a(n-7). (End)
MATHEMATICA
a[n_ /; Mod[n, 4] == 0] := n+1; a[n_ /; Mod[n, 4] == 1] := -(3n+1)/2; a[n_ /; Mod[n, 4] == 2] := (3n+2)/2; a[n_ /; Mod[n, 4] == 3] := -n; Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Sep 03 2012 *)
LinearRecurrence[{-1, -1, -1, 1, 1, 1, 1}, {1, -2, 4, -3, 5, -8, 10}, 60] (* Harvey P. Dale, Mar 24 2023 *)
PROG
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x+3*x^2+3*x^4-x^5+x^6)/((1-x)*(1+x+x^2+x^3)^2))); // Bruno Berselli, Sep 06 2012
(Maxima) makelist(expand(1+(5-%i^(n*(n+1)))*((2*n+1)*(-1)^n-1)/8), n, 0, 60); /* Bruno Berselli, Sep 07 2012 */
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Aug 25 2012
STATUS
approved