OFFSET
1,2
COMMENTS
The denominators are 2,2,2,1,1,2,2,2,1,1,2,2,2,1,1,...
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,-1,1,-1,1,1,-1,1,-1,1,-1).
FORMULA
a(3n+1) = (-1)^n.
a(6n-1) = a(6n) = -3n.
a(6n+2) = a(6n+3) = 6n+3.
a(n) = Numerator of ((n+1)*sin((n*Pi)/3)-n*sin(((n+1)*Pi)/3))/sqrt(3).
a(n) = a(n - 1) - a(n - 2) + a(n - 3) - a(n - 4) + a(n - 5) + a(n - 6) - a(n - 7) + a(n - 8) - a(n - 9) + a(n - 10) - a(n - 11) for n > 11. - Stefano Spezia, Oct 27 2018
G.f.: x*(1 + 2*x + x^2 - 2*x^3 - x^4 - 2*x^5 + x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)*(1 - x + x^2)^2*(1 + x + x^2)^2). - Colin Barker, Oct 28 2018
EXAMPLE
For n = 1 the sum is simply 1*sin((Pi*1)/3)/sqrt(3) = 1/2. So, a(1) = 1.
MAPLE
a:=n->add((k*sin((Pi*k)/3))/sqrt(3), k=1..n): seq(numer(a(n)), n=1..50); # Muniru A Asiru, Oct 28 2018
MATHEMATICA
a[n_]:=Numerator[Sum[(k*Sin[(Pi*k)/3])/Sqrt[3], {k, 1, n}]]; Array[a, 50] (* or *) LinearRecurrence[{1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1}, {1, 3, 3, -1, -3, -3, 1, 9, 9, -1, -6}, 50] (* Stefano Spezia, Oct 27 2018 *)
PROG
I:=[1, 3, 3, -1, -3, -3, 1, 9, 9, -1, -6]; [n le 11 select I[n] else Self(n-1)- Self(n-2)+Self(n-3)-Self(n-4)+Self(n-5)+Self(n-6)-Self(n-7)+Self(n-8)- Self(n-9)+Self(n-10)-Self(n-11): n in [1..100]]; // Vincenzo Librandi, Oct 28 2018
(PARI) Vec(x*(1 + 2*x + x^2 - 2*x^3 - x^4 - 2*x^5 + x^6 + 2*x^7 + x^8) / ((1 - x)^2*(1 + x)*(1 - x + x^2)^2*(1 + x + x^2)^2) + O(x^80)) \\ Colin Barker, Oct 28 2018
CROSSREFS
KEYWORD
sign,frac,easy
AUTHOR
Peter James Foreman, Oct 27 2018
EXTENSIONS
More terms from Vincenzo Librandi, Oct 28 2018
STATUS
approved