OFFSET
0,2
COMMENTS
Essentially a permutation of A129756 (odd numbers repeated four times).
a(-1) = 3, a(-2) = a(-3) = 1.
Distance between the first two (2*k+1)'s: 2*k+1 terms. Distance between the last two (2*n+1)'s: 4 terms. Essentially same distances as in -a(-n) = -1, -3, -1, -1, 1, 1, 1, 3, 1, 5, 3, 7, 3, 9, 5, 11, 3, 13, 7, 15, 5, 17, 9, 19, 5, 21, 11, 23, 7, 25, 13, 27, 7, ... .
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1,0,0,0,1,0,0,0,-1).
FORMULA
a(n) = a(n-4) + a(n-8) - a(n-12).
A246416(n+4) - a(n) = sequence of period 4: [1, 0, 0, 0].
a(n+4) - a(n) = sequence of period 8: [0, 4, 2, 4, 2, 4, 2, 4].
G.f.: -(3*x^11+x^10+x^9-x^8-4*x^7-2*x^6-4*x^5-7*x^3-3*x^2-5*x-1) / ((x-1)^2*(x+1)^2*(x^2+1)^2*(x^4+1)). - Colin Barker, Sep 21 2014
a(n) = a(n-8) + sequence of period 4: [2, 8, 4, 8] (= 2*A176895(n)).
a(n) = (n+4)*(1-ceiling((2-n)/4)-ceiling((n-2)/4))/2+(n+4)*(1+floor((1-n)/2)+floor((n-1)/2))-(n+2+2(-1)^(n/4))*(ceiling(n/4)-floor(n/4)-1)/4. - Wesley Ivan Hurt, Sep 21 2014
MAPLE
A247617:=n->(n+4)*(1-ceil((2-n)/4)-ceil((n-2)/4))/2+(n+4)*(1+floor((1-n)/2)+floor((n-1)/2))-(n+2+2*(-1)^(n/4))*(ceil(n/4)-floor(n/4)-1)/4: seq(A247617(n), n=0..50); # Wesley Ivan Hurt, Sep 21 2014
MATHEMATICA
Table[(n + 4) (1 - Ceiling[(2 - n)/4] - Ceiling[(n - 2)/4])/2 + (n + 4) (1 + Floor[(1 - n)/2] + Floor[(n - 1)/2]) - (n + 2 + 2 (-1)^(n/4)) (Ceiling[n/4] - Floor[n/4] - 1)/4, {n, 0, 50}] (* Wesley Ivan Hurt, Sep 21 2014 *)
PROG
(PARI) Vec(-(3*x^11+x^10+x^9-x^8-4*x^7-2*x^6-4*x^5-7*x^3-3*x^2-5*x-1)/((x-1)^2*(x+1)^2*(x^2+1)^2*(x^4+1)) + O(x^100)) \\ Colin Barker, Sep 21 2014
(Magma) I:=[1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15]; [n le 12 select I[n] else Self(n-4)+Self(n-8)-Self(n-12): n in [1..80]]; // Vincenzo Librandi, Oct 15 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Sep 21 2014
STATUS
approved