In a shop there are infinitely many cards with exactly one natural number written on each of them. Suppose for any $n \geq 1$ there are exactly $n$ cards hosting a number $d$ such that it's a divisor of $n$. For example if $n=6$ there are exactly six cards with number belonging to the set ${1,2,3,6}$. Prove that every natural number occurs at least once among the cards.
I found a solution here which proposes the formula that $g(ip)=g(i) \times g(p)$ where $i$ is an integer, $p$ is a prime, and $i,p$ are coprime. Here $g(k)=\text{number of cards with k written on it}$. They provided no proof of it. I tried to prove it with induction but failed. I know that for any prime $p$, $g(p)=p-1$, how do I prove thus formula?