Given $n,d\in \mathbb{Z}^+$, how many subgroups of index $d$ does the free group of
rank $n$ have?


In case $n=1$ the question is trivial, and in case $n=2, d=2$ there are 3 such subgroups.
I think I have got a algorithm to solve case $d=2$ for arbitrary $n$.
But the general case seems very difficult. For example in case $n=2$ and $d$ a
prime number, I don't know how to proceed.


That's my question. Any suggestions will be appreciated.
Thanks



Number of subgroups of a given index of a free group
This calculation was performed by [Marshall Hall Jr](http://www.ams.org/mathscinet/search/publdoc.html?arg3=&co4=AND&co5=AND&co6=AND&co7=AND&dr=all&pg4=AUCN&pg5=AUCN&pg6=PC&pg7=ALLF&pg8=ET&review_format=html&s4=hall%2C%20m*&s5=&s6=&s7=&s8=All&vfpref=html&yearRangeFirst=&yearRangeSecond=&yrop=eq&r=181&mx-pid=28836). Let $N(d,n)$ be the number of subgroups of index $d$ in the free group of rank $n$. Then


$N(d,n)=d(d!)^{n-1}-\sum\_{i=1}^{d-1}((d-i)!)^{n-1}N(i,n)$.


One can prove this inductively by analysing permutation groups as in abx's answer, or alternatively by thinking about covering spaces of graphs---see the answers to [this question on MSE](https://math.stackexchange.com/questions/9705/finding-subgroups-of-a-free-group-with-a-specific-index) for a few more details.


