OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1,-1,-1,-1,-1,2,2,2,2,2,2,2,2,-1,-1,-1,-1,-1,-1,-1,-1).
FORMULA
a(2*n) + a(2*n+1) = A144396(n+1).
It seems that a(n) = 3 iff n in A131098.
a(n)= -a(n-1) -a(n-2) -a(n-3) -a(n-4) -a(n-5) -a(n-6) -a(n-7) +2*a(n-8) +2*a(n-9) +2*a(n-10) +2*a(n-11) +2*a(n-12) +2*a(n-13) +2*a(n-14) +2*a(n-15) -a(n-16) -a(n-17) -a(n-18) -a(n-19) -a(n-20) -a(n-21) -a(n-22) -a(n-23). - R. J. Mathar, Dec 08 2010
From Luce ETIENNE, Dec 29 2019: (Start)
a(n) = 3*a(n-8) - 3*a(n-16) + a(n-24).
a(n) = (3*(264*m^7 - 6377*m^6 + 60963*m^5 - 293615*m^4 + 748881*m^3 - 962528*m^2 + 502812*m - 25200)*floor(n/8)^2 + 7*(136*m^7 - 3209*m^6 + 29731*m^5 - 137375*m^4 + 332209*m^3 - 400496*m^2 + 194844*m - 5040)*floor(n/8) + m*(472*m^6 - 11235*m^5 + 105049*m^4 - 488985*m^3 + 1181803*m^2 - 1389780*m + 617796))/5040, where m = n mod 8. (End)
MAPLE
MATHEMATICA
LinearRecurrence[{-1, -1, -1, -1, -1, -1, -1, 2, 2, 2, 2, 2, 2, 2, 2, -1, -1, -1, -1, -1, -1, -1, -1}, {0, 3, 2, 3, -5, 12, 6, 3, -22, 33, 10, 3, -33, 48, 14, 3, -74, 93, 18, 3, -85, 108, 22}, 90] (* Harvey P. Dale, Apr 17 2015 *)
b[n_]:= If[OddQ[n], (n-1)*(n+3)/4, (n^2+4*n-12)*(37 +27*(-1)^(n/2) +6*Cos[(n+2)*Pi/4])/2^8]; Table[b[n+2] - b[n+1], {n, 0, 90}] (* G. C. Greubel, Dec 04 2019 *)
PROG
(PARI) b(n) = if(n%2==1, (n-1)*(n+3)/4, round((n^2+4*n-12)*(37 +27*(-1)^(n/2) +6*cos((n+2)*Pi/4))/2^8) );
vector(91, n, b(n+1) - b(n) ) \\ G. C. Greubel, Sep 19 2018; Dec 04 2019
(Magma) R:= RealField(20);
b:= func< n | (n mod 2) eq 1 select (n-1)*(n+3)/4 else Round((n^2+4*n-12)*(37 +27*(-1)^(n/2) +6*Cos((n+2)*Pi(R)/4))/2^8) >;
[b(n+2) - b(n+1): n in [0..90]]; // G. C. Greubel, Sep 19 2018; Dec 04 2019
(Sage)
def b(n):
if (mod(n, 2)==1): return (n-1)*(n+3)/4
else: return round((n^2+4*n-12)*(37 +27*(-1)^(n/2) +6*cos((n+2)*pi/4))/2^8)
[b(n+2) -b(n+1) for n in (0..90)] # G. C. Greubel, Dec 04 2019
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul Curtz, Dec 04 2010
STATUS
approved