login
a(n) = Sum_{k=0..n} (2^k + 1) * (2^k + 2) / 2.
2

%I #48 Nov 21 2021 19:09:04

%S 3,9,24,69,222,783,2928,11313,44466,176307,702132,2802357,11197110,

%T 44763831,179006136,715926201,2863508154,11453639355,45813770940,

%U 183253510845,733010897598,2932037298879,11728136612544,46912521284289,187650034805442,750600038558403

%N a(n) = Sum_{k=0..n} (2^k + 1) * (2^k + 2) / 2.

%C All terms are multiples of 3.

%H Roger B. Nelson, <a href="https://www.jstor.org/stable/30044199">Proof without Words: A Triangular Sum</a>, Mathematics Magazine Vol. 78, No. 5 (December 2005), p. 395.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (8,-21,22,-8).

%F a(n) = (2^(n+1) + 4) * (2^(n+1) + 5) / 6 - 4 + n.

%F More generally: let f(n, b) be the triangular sum Sum_{k=0..n} (2^k+b) * (2^k+b+1) / 2.

%F f(n, b) = (2^(n+1) + 3*b + 1) * (2^(n+1) + 3*b + 2) / 6 - (b + 1)^2 + b*(b + 1)*n / 2.

%F G.f.: ((b^2+3*b+2)/2 - (3*b^2+8*b+4)*x + (4*b^2+8*b+3)*x^2) / ((4*x-1) * (2*x-1) * (x-1)^2).

%F E.g.f.: exp(x) * ((6*b+3)*exp(x) + 2*exp(3*x) + 3(b^2+b)*x/2 + (3*b^2-3*b-4) / 2) / 3.

%F Then b = -1 gives A006095, b = 0 gives A076024, b = 1 gives A346295, b = 2 gives A346375.

%F G.f.: 3*(5*x^2 - 5*x + 1) / ((4*x - 1) * (2*x - 1) * (x - 1)^2).

%F a(n) = 8*a(n-1) - 21*a(n-2) + 22*a(n-3) - 8*a(n-4) for n > 3.

%F This recurrence is valid for all sequences f(n,b).

%F E.g.f.: exp(x) * (9*exp(x) + 2*exp(3*x) + 3*x - 2) / 3. - _Stefano Spezia_, Aug 13 2021

%p a:= proc(n) option remember:

%p if n=0 then 3 else (2^n+1)*(2^n+2)/2+procname(n-1) fi:

%p end proc:

%p seq(a(n), n=0..30);

%t Accumulate @ Table[(2^k + 1)*(2^k + 2)/2, {k, 0, 25}] (* _Amiram Eldar_, Jul 27 2021 *)

%t LinearRecurrence[{8,-21,22,-8},{3,9,24,69},30] (* _Harvey P. Dale_, Nov 21 2021 *)

%o (PARI) a(n)=sum(k=0, n, (2^k+1)*(2^k+2)/2); \\ _Michel Marcus_, Jul 16 2021

%Y Cf. A028401 (first differences).

%Y Cf. A006095, A076024.

%K nonn,easy

%O 0,1

%A _Paul Weisenhorn_, Jul 13 2021