The problem:
Find the recurrence formula for number of permutations if a cube of any such permutation is identity permutation.
Solving:
We have to count the number of permutations $\pi$ such that $\pi ^ 3 = e$. All such permutations may be presented as products of cycles with length $1$ or $3$.
Let $f(n)$ be the number of such permutations on the set $\{1,...,n\}$.
Let's consider the set $\{1\}$. We see that $f(1) = 1$, because the permutation is $(1)$.
Let's consider the set $\{1,2\}$. Now we can form permutation $(1)(2)$. Therefore $f(2) = 1$.
Now consider the set $\{1,2,3\}$. We can form 3 permutations: $(1)(2)(3)$, $(123)$, $(132)$ such that the cube of each permutation is the identity permutation. And so $f(3) = 3$.
And so on...