OFFSET
1,1
LINKS
DefElement, Serendipity
Index entries for linear recurrences with constant coefficients, signature (3,-3,1).
FORMULA
a(1) = 4, a(n) = n*(n+3)/2 + 3 (if n > 1).
From Stefano Spezia, Jan 02 2021: (Start)
G.f.: x*(4 - 4*x + x^3)/(1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 4. (End)
a(n) = (A111802(n+2)+1)/2 + 2. - Hugo Pfoertner, Jan 02 2021
MATHEMATICA
A340266[n_] := Module[{a}, a[1] = 4; a[i_] := a[i] = i*(i + 3)/2 + 3; a[n]]; Table[A340266[n], {n, 1, 49}] (* Robert P. P. McKone, Jan 29 2021 *)
LinearRecurrence[{3, -3, 1}, {4, 8, 12, 17}, 50] (* Harvey P. Dale, Oct 24 2021 *)
PROG
(Python) print([4 if n == 1 else n * (n + 3) // 2 + 3 for n in range(1, 50)])
(PARI) a(n) = if (n==1, 4, n*(n+3)/2 + 3); \\ Michel Marcus, Jan 04 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Matthew Scroggs, Jan 02 2021
STATUS
approved