login
Total number of factorial parts in all compositions of n.
1

%I #13 Jan 10 2023 13:05:03

%S 0,1,3,7,17,40,93,210,469,1036,2268,4928,10640,22848,48832,103936,

%T 220416,465920,982016,2064384,4329472,9060352,18923520,39452672,

%U 82116609,170655746,354156549,734003212,1519386652,3141533760,6488588432,13388218688,27598521024

%N Total number of factorial parts in all compositions of n.

%H Alois P. Heinz, <a href="/A309538/b309538.txt">Table of n, a(n) for n = 0..3312</a>

%F G.f.: Sum_{k>=1} x^(k!)*(1-x)^2/(1-2*x)^2.

%F a(n) ~ c * 2^n * n, where c = 0.1914062649011611938476562500000000001880790961... - _Vaclav Kotesovec_, Aug 18 2019

%p g:= proc(n) local i; 1; for i from 2 do

%p if n=% then 1; break elif n<% then 0; break fi;

%p %*i od; g(n):=%

%p end:

%p a:= proc(n) option remember; add(a(n-j)+

%p `if`(g(j)=1, ceil(2^(n-j-1)), 0), j=1..n)

%p end:

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

%t g[n_] := g[n] = Module[{i, p = 1}, For[i = 2, True, i++, If[n == p, p = 1; Break[], If[n<p, p = 0; Break[]]]; p = p*i]; p];

%t a[n_] := a[n] = Sum[a[n-j] + If[g[j] == 1, Ceiling[2^(n-j-1)], 0], {j, 1, n}];

%t Table[a[n], {n, 0, 33}] (* _Jean-François Alcover_, Jan 10 2023, after _Alois P. Heinz_ *)

%Y Cf. A000142, A102291.

%K nonn

%O 0,3

%A _Alois P. Heinz_, Aug 06 2019