OFFSET
1,2
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..1000
Joseph Myers, BMO 2008--2009 Round 1 Problem 1---Generalisation
FORMULA
a(n) = n*2^(2*n-2) - (2*n-1)*binomial(2*n-2,n-1).
4^n*(n+1)-C(2*n,n)*(2*n+1) = Sum_{k=1..n} C(2*(n-k),n-k)*C(2*k,k)*k*(H(k)-H(n-k)) for n >= 0; H(n) denote the harmonic numbers. This identity is attributed to Maillard. - Peter Luschny, Sep 17 2015
EXAMPLE
a(3) = 3*2 ^ (2*3 - 2) - (2*3 - 1) * binomial(2*3 - 2, 3 - 1) = 18. - Indranil Ghosh, Feb 19 2017
MATHEMATICA
Table[n 2^(2 n - 2) - (2 n - 1) Binomial[2 n - 2, n - 1], {n, 22}] (* Michael De Vlieger, Sep 17 2015 *)
PROG
(Magma) [(n)*2^(2*n-2)-(2*n-1)*Binomial(2*n-2, n-1): n in [1..30]]; // Vincenzo Librandi, Sep 18 2015
(Python)
import math
def C(n, r):
....f=math.factorial
....return f(n)/f(r)/f(n-r)
def A153338(n):
....return str(n*2**(2*n-2)-(2*n-1)*C(2*n-2, n-1)) # Indranil Ghosh, Feb 19 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joseph Myers, Dec 24 2008
EXTENSIONS
a(23)-a(24) from Vincenzo Librandi, Sep 18 2015
STATUS
approved