A247617 a(4n) = n + 1/2 - (-1)^n/2 + (-1)^n, a(2n+1) = 2*n + 5, a(4n+2) = 2*n + 3.
1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 3, 17, 9, 19, 5, 21, 11, 23, 5, 25, 13, 27, 7, 29, 15, 31, 7, 33, 17, 35, 9, 37, 19, 39, 9, 41, 21, 43, 11, 45, 23, 47, 11, 49, 25, 51, 13, 53, 27, 55, 13, 57, 29, 59, 15, 61, 31, 63, 15, 65, 33, 67
Offset: 0
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).
Programs
-
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
-
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 *)
-
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
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
Comments