Triangle groups, automorphic forms, and torus knots