A glimpse of 2D and 3D quantum field theories through number theory