I haven't find a way to solve the problem using Mathematica straight away, but we can use it to navigate the formulas and for finding the relevant closed expressions. Please beware that the following is far from a formal proof and only an educated guess (how well "educated" is a matter of discussion, though :)
At the end of this post you'll find a self-consistency numeric experiment, i.e. by using the guessed closed forms, if you start with the A[0]
value we will find next, you arrive at A[L]==0
after using the recurrence relations.
If we define
B[L, _] := 0;
B[l_, g_] := 1 + Sum[Binomial[g, j] B[l + 1, j], {j, 0, g}]
then:
FindSequenceFunction /@ Table[B[L - n, g], {n, 1, 7}, {g, 15}]
(*
{1 &,
1 + 2^#1 &,
1 + 2^#1 + 3^#1 &,
1 + 2^#1 + 2^(2 #1) + 3^#1 &,
1 + 2^#1 + 2^(2 #1) + 3^#1 + 5^#1 &,
1 + 2^#1 + 2^(2 #1) + 3^#1 + 5^#1 + 6^#1 &,
1 + 2^#1 + 2^(2 #1) + 3^#1 + 5^#1 + 6^#1 + 7^#1 &}
*)
As 2^2==4
:) this means (first guess)
B[L - n, g] == HarmonicNumber[ n, -g]
An that is a "closed form" for B[ ]
Now we have
A[l] == 1 + 2^d A[l+1] + Sum[ Binomial[d, g] B[l+1, g], {g, 0, d-1} ]
And we will try to guess the Sum
part:
Sum[ Binomial[d, g] B[l+1, g], {g, 0, d-1} ]
first,in order to use the closed form for B
found above, we rewrite
l + 1 == L - (L - l - 1)
Then the sum is
Sum[Binomial[d, g] HarmonicNumber[L - l - 1, -g], {g, 0, d - 1}]
And again, we try to find a closed form with:
FindSequenceFunction /@
Table[Sum[Binomial[d, g] HarmonicNumber[i, -g], {g, 0, d - 1}], {i, 1, 6}, {d, 1, 10}]
(* {-1 + 2^#1 &, -1 + 3^#1 &, -1 + 4^#1 &, -1 + 5^#1 &, -1 + 6^#1 &, -1 + 7^#1 &} *)
So it is (second guess)
ourSum[i,d] -> -1 + (i+1)^d
Since in our actual sum i -> L -l -1
, that means
ourSum -> -1 + (L-l)^d
Replacing in the expression for A[l]
A[l] == 1 + 2^d A[l + 1] - 1 + (L - l)^d
or
A[l] == 2^d A[l + 1] + (L - l)^d
Now we can use RSolve[ ]
for our third guess:
Table[(A[l] /. RSolve[#, A[l], l] &@({A[l] == 2^d A[l + 1] + (L - l)^d, A[L] == 0}
/. L -> i) /. l -> 0),
{i, 2, 7}]
(*
{{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -2] + 2^(2 d) HurwitzLerchPhi[2^d, -d, 0])},
{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -3] + 2^(3 d) HurwitzLerchPhi[2^d, -d, 0])},
{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -4] + 2^(4 d) HurwitzLerchPhi[2^d, -d, 0])},
{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -5] + 2^(5 d) HurwitzLerchPhi[2^d, -d, 0])},
{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -6] + 2^(6 d) HurwitzLerchPhi[2^d, -d, 0])},
{-(-1)^d (-HurwitzLerchPhi[2^d, -d, -7] + 2^(7 d) HurwitzLerchPhi[2^d, -d, 0])}}
*)
So we guess the closed form for the total cost
A[0] = -(-1)^d (-HurwitzLerchPhi[2^d, -d, -L] + 2^(L d) HurwitzLerchPhi[2^d, -d, 0])
Self consistency
Let's see if we arrive at A[L]==0
by using this value for A[0]
and the closed form for B[ ]
:
B[x_, g_]:= HarmonicNumber[L - x, -g];
f[d_, k_]:= Block[{L = k},
RecurrenceTable[{A[1 + l]== 2^-d (-1 + A[l] -
Sum[B[1 + l,g]*Binomial[d, g], {g, 0, -1 + d}]),
A[0] == -(-1)^d (-HurwitzLerchPhi[2^d, -d, -L] +
2^(L d) HurwitzLerchPhi[2^d, -d, 0])},
A, {l, L}]]
Table[Last@f[d, k], {d, 10}, {k, 10}]
(*
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
*)
So, at least the solution we found is self-consistent!
B
isB[L+1,_]==0
because you don't want the total cost in terms ofg
$\endgroup$