OFFSET
0,2
REFERENCES
Eric Billault, Walter Damin, Robert Ferréol, Rodolphe Garin, MPSI Classes Prépas - Khôlles de Maths, Exercices corrigés, Ellipses, 2012, exercice 2.22 (2), pp. 26, 43-44.
LINKS
FORMULA
a(n) = (2*n-1) * 2^(n+1) + 3.
G.f.: -(2*x+1)/((x-1)*(2*x-1)^2). - Alois P. Heinz, Dec 16 2020
E.g.f: 3*exp(x) + 2*exp(2*x)*(4*x - 1). - Stefano Spezia, Dec 16 2020
a(n) = (2*A027981(n)+1)/3 for n >= 1. - Hugo Pfoertner, Dec 17 2020
EXAMPLE
a(3) = 5*2^4 + 3 = 83.
MAPLE
seq((2*n-1)*2^(n+1)+3, n=0..40);
MATHEMATICA
Table[(2*n - 1)*2^(n + 1) + 3, {n, 0, 29}] (* Amiram Eldar, Dec 16 2020 *)
PROG
(PARI) a(n) = sum(i=0, n, sum(j=0, n, 2^max(i, j))); \\ Michel Marcus, Dec 16 2020
(Python)
def A339771():
a, b, c = 1, 7, 27
yield(a); yield(b)
while True:
yield c
z = 4*a - 8*b + 5*c
a, b, c = b, c, z
a = A339771()
print([next(a) for _ in range(30)]) # Peter Luschny, Dec 17 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bernard Schott, Dec 16 2020
STATUS
approved