OFFSET
0,3
LINKS
Index entries for linear recurrences with constant coefficients, signature (7,-17,17,-6)
FORMULA
G.f.: x*(1+3*x) / ( (3*x-1)*(2*x-1)*(x-1)^2 ). - R. J. Mathar, Jan 21 2018
MATHEMATICA
Array[(3^(# + 2) + 11)/2 - 5*2^(# + 1) + 2 # &, 29, 0] (* or *)
CoefficientList[Series[x (1 + 3 x)/((3 x - 1) (2 x - 1) (x - 1)^2), {x, 0, 28}], x] (* Michael De Vlieger, Jan 21 2018 *)
PROG
(PARI) A298564(n)=2*n-5<<(n+1)+3^(n+2)\2+5
(Python)
def A298564list(n):
def generator():
a, b, c = 5, 3, 0
while True:
yield c
a *= 2
b *= 3
c += 2 - a + b
a = generator()
return [next(a) for _ in range(n)]
print(A298564list(29)) # Peter Luschny, Jan 22 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Jan 21 2018
STATUS
approved