First get this clear ...
m1 denotes the number of values in {1,..,n} divisible by p
m2 denotes the number of values in {1,..,n} divisible by p^2
m3 denotes the number of values in {1,..,n} divisible by p^3
...
...
mk denotes the number of values in {1,..,n} divisible by p^k

if a is divisible by p^j and not by p^j+1
that means the maximum power of p that can divide a is j ...

if p^j|a then p|a,p^2|a,p^3|a,p^4|a,.....,p^j|a

that means this number a will have been counted in m1,m2,m3,m4,....,mj
t = sum of all m_i's
so a will have been counted j times in t ....

or in other words contribute an m_i towards t
(can u see why?)