OFFSET
1,2
LINKS
Nicolay Avilov, Scheme
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-3,3,-1).
FORMULA
Let r = n mod 3, then we get
a(n) = n*(n^2+3)/6 if r = 0;
(n*(n^2+3)+2)/6 if r = 1;
(n*(n^2+3)-2)/6 if r = 2.
G.f.: x*(x^4-x^3+3*x^2-x+1)/((x^2+x+1)*(x-1)^4).
E.g.f.: (3*exp(x)*x*(4 + 3*x + x^2) + 4*sqrt(3)*exp(-x/2)*sin(sqrt(3)*x/2))/18. - Stefano Spezia, Apr 19 2025
a(n) = round(n^3/6+n/2). - Hoang Xuan Thanh, Jul 25 2025
EXAMPLE
The parts and resulting sums begin:
Part Sum = a(n)
n=1: 1, ....................... 1
n=2: 1, 1, .................... 2
n=3: 2, 2, 2, ................. 6
n=4: 3, 3, 3, 4, .............. 13
n=5: 4, 4, 5, 5, 5, ........... 23
n=6: 6, 6, 6, 7, 7, 7, ........ 39
n=7: 8, 8, 8, 9, 9, 9, 10, ..... 61
MATHEMATICA
LinearRecurrence[{3, -3, 2, -3, 3, -1}, {1, 2, 6, 13, 23, 39}, 46] (* James C. McMahon, Apr 22 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nicolay Avilov, Mar 04 2024
STATUS
approved
