Actually, your inner product should have limits of integration, which is the period of f; otherwise your inner product is not a number as it should be. Your multipliers of ##1/\sqrt \pi## or anything else make no difference whatever to the orthogonality. They are used to set the length of each basis element to 1, but I think you need a factor of ##1/2\pi## (if you are integrating from ##-\pi \text{ to } \pi##.
If you compute the coefficients then they turn out to be ##a_n = (1/\pi) \int_{-\pi}^{\pi}f(t)cos(nt)dt## and similarly for the sin coefficients. The coefficient ##1/\pi## is really 2/P where P is the period of f. So if the period is ##2\pi## you will wind up with ##1/\pi##.
It arises due to the length of the interval over which you are integrating.
Specifically, we want the Fourier expansion to converge to F, and without that factor it will converge to ##\pi f##.