OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-6,10,-12,12,-10,6,-3,1).
FORMULA
a(n) = 3*a(n-1) -6*a(n-2) +10*a(n-3) -12*a(n-4) +12*a(n-5) -10*(n-6) +6*(n-7) -3*a(n-8) +a(n-9) = 3*a(n-4) -3*a(n-8) +a(n-12).
G.f.: x*(2-3*x+9*x^2+3*x^5+x^6)/((1-x)^3*(1+x^2)^3). - Bruno Berselli, Jul 10 2013
a(n) = (3+(-1)^floor(n/2))*n*(n+1)/4. - Bruno Berselli, Jul 10 2013
Sum_{n>=1} 1/a(n) = 1 + log(2)/2. - Amiram Eldar, Aug 12 2022
EXAMPLE
a(0) = 2*0 = 0, a(1) = 2*1 = 2, a(2) = 1*3 = 3, a(3) = 1*6 = 6, a(4) = 2*10 = 20.
MATHEMATICA
a[n_] := n*(n+1)/4*GCD[n-1, 4]*GCD[n, 4]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 10 2013 *)
Table[If[Mod[n, 4]<2, n(n+1), (n(n+1))/2], {n, 0, 50}] (* or *) LinearRecurrence[ {3, -6, 10, -12, 12, -10, 6, -3, 1}, {0, 2, 3, 6, 20, 30, 21, 28, 72}, 50] (* Harvey P. Dale, Aug 26 2016 *)
PROG
(Magma) [(3+(-1)^Floor(n/2))*n*(n+1)/4: n in [0..50]]; // Bruno Berselli, Jul 10 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jul 06 2013
STATUS
approved