Representation theory and automorphic functions