The problem statement and the official answer was not written in English BTW.
$~7~$piggy banks and$~7~$corresponding keys are given.
Each key is stored into an piggy bank.
A key can be obtained via opening a piggy bank using a corresponding key or breaking that piggy bank.
Evaluate the expected value of number of piggy bank(s) which is/are needed to be broken to obtain the all keys.
The official answer of the formula is given as follows.
$$ 1+{1\over 7}+{1\over 6}+{1\over 5}+{1\over 4}+{1\over 3}+{1\over 2}={363\over 140} ~~~\left[\text{piggy banks}\right] $$
I can understand that at least one piggy bank should be broken to obtain the first key but I cannot get the meanings of the rest of the terms above shown in LHS of the equation.
In the first place, the definition of an expected value for me is like as follows, which seems not relative to this problem.
$$ E[X]=\sum_{i=1}^{n}p_i x_i~~~\text{or}~~~E[X]=\int_{-\infty}^{+\infty}x\cdot\operatorname{pdf}(x)~\mathrm{d}x $$
A key inside a piggy banks is to be one of 2 cases as we act optimally.
One of which is a key of a type which yet obtained and the other is a key inside a piggy banks which is to be broken at last.
Hence as we obtained a key and$~k~$unbroken piggy banks remaining, the probabily of a next bank should be broken is$~{1\over k+1}~$