I wrote a program for rotating vectors about three Euler angles, according to this definition of the rotation matrix: http://pl.wikipedia.org/wiki/K%C4%85ty_Eulera . When testing it, I made it rotate the given vector by the angles $\frac{2 \pi}{3}, \frac{2 \pi}{4}, \frac{2 \pi}{5}$ a total of $3 \cdot 4 \cdot 5 = 60$ times, thinking this would get me the original vector back, but it doesn't, and I don't know why. I checked the code and it looks alright, so it seems to me the fallacy is mathematical, but I don't understand what's wrong. I saw on the wiki page that the last angle was meant to be from $[0,\pi)$, but replacing $ \frac{2 \pi}{5}$ with $\frac{\pi}{5}$ also doesn't work.

Rotations don't generally commute. So if A, B, C are your three rotations about the three axes,
$$A^3=B^4=C^5=I$$ but $$(CBA)^{60} = (CBA)(CBA)(CBA)\ldots \neq C^{60}B^{60}A^{60}.$$