This division shall be carried out on the basis of the ratio which the length of the periods of old-age insurance or residence referred to in Article 45 (1) completed under the legislation of each of the States bears to the total length of the periods of old-age insurance or residence completed under the legislation of all the States at the dates on which the benefits commenced.