OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
From Philippe Deléham, Feb 16 2004: (Start)
a(2*n) = (n/6)*(7*n^2 + 3*n + 2);
a(2*n-1) = (n/6)*(7*n^2 - 6*n + 5). (End)
G.f.: x*(1+x+2*x^2+2*x^3+x^4) / ( (1+x)^3*(1-x)^4 ). - R. J. Mathar, Aug 23 2012
From Richard Peterson, Aug 19 2020: (Start)
a(2*n) - a(2*n-1) = A000326(n).
a(2*n+1) - a(2*n) = n^2 + (n+1)^2. (End)
a(n) = (15 + 25*n + 15*n^2 + 14*n^3 - 3*(-1)^n*(5 + n*(3 + n)))/96. - Torlach Rush, Aug 14 2022
E.g.f.: (1/48)*( x*(33 + 27*x + 7*x^2)*cosh(x) + (15 + 21*x + 30*x^2 + 7*x^3)*sinh(x) ). - G. C. Greubel, Dec 08 2023
MAPLE
A079824aux := proc(n, k)
A000124(n)+k ;
end proc:
A079824 := proc(n)
local a, k, n0 ;
n0 := n-1 ;
a := 0 ;
for k from 0 to floor(n0/2) do
a := a+A079824aux(n0-k, k) ;
end do:
a ;
end proc: # R. J. Mathar, Aug 23 2012
MATHEMATICA
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 2, 7, 12, 25, 37, 62}, 60] (* Harvey P. Dale, May 06 2014 *)
PROG
(Python)
def a(n): return (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96 # Torlach Rush, Aug 14 2022
(Magma) [(15+25*n+15*n^2+14*n^3 -3*(-1)^n*(5+3*n+n^2))/96: n in [1..60]]; // G. C. Greubel, Dec 08 2023
(SageMath) [(15+25*n+15*n^2+14*n^3 -3*(-1)^n*(5+3*n+n^2))/96 for n in range(1, 61)] # G. C. Greubel, Dec 08 2023
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Feb 11 2003
EXTENSIONS
More terms from Jason D. W. Taff (jtaff(AT)jburroughs.org), Oct 31 2003
More terms from Philippe Deléham, Feb 16 2004
Typo corrected by Kevin Ryde, Aug 23 2012
STATUS
approved