OFFSET
1,3
COMMENTS
Mingles the numerators of the Lyman and Balmer series of the hydrogen problem.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,-3,0,0,0,0,0,0,0,1).
FORMULA
a(n) = 3*a(n-8) - 3*a(n-16) + a(n-24). - R. J. Mathar, Dec 08 2010
G.f.: x^3*(3*x^21 + x^20 + x^19 + 3*x^17 - 3*x^16 - 8*x^14 - 14*x^13 - 18*x^12 - 6*x^11 - 24*x^10 - 30*x^9 - 26*x^8 - 2*x^7 - 24*x^6 - 21*x^5 - 15*x^4 - 3*x^3 - 8*x^2 - 5*x -3) / ((x-1)^3*(x+1)^3*(x^2+1)^3*(x^4+1)^3). - Colin Barker, Jan 26 2014
a(n) = (n-1)*(n+3)/4 when n is odd, otherwise (n^2+4*n-12)*(37 + 27*(-1)^(n/2) + 6*cos((n+2)*Pi/4))/2^8. - G. C. Greubel, Dec 04 2019
Sum_{n>=3} 1/a(n) = 31/12. - Amiram Eldar, Aug 14 2022
MAPLE
seq( `if`( (n mod 2) = 1, (n-1)*(n+3)/4, (n^2+4*n-12)*(37 +27*(-1)^(n/2) +6*cos((n+2)*Pi/4))/2^8 ), n=1..90); # G. C. Greubel, Dec 04 2019
MATHEMATICA
a[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[a[n], {n, 90}] (* G. C. Greubel, Sep 19 2018; Dec 04 2019 *)
PROG
(PARI) a(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) ); \\ G. C. Greubel, Sep 19 2018; Dec 04 2019
(Magma) R:= RealField(20);
a:= 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) >;
[a(n): n in [1..90]]; // G. C. Greubel, Sep 19 2018; Dec 04 2019
(Sage)
def a(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)
[a(n) for n in (1..90)] # G. C. Greubel, Dec 04 2019
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Paul Curtz, Dec 04 2010
STATUS
approved