What equation predicts the amplitudes of harmonics from a square/triangle/sawtooth/pulse oscillator? I have seen pictures like this which depict the shapes of amplitudes from the various common types of audio oscillators:

Similar pictures of spectra are shown here.
I am attempting recreating these with additive synthesis using sine waves, and I thus need to know what levels to set the component sine waves to.
I'm wondering if there are simple equations that can predict the level of a given partial/harmonic relative to a level of 1 for the fundamental for each type of wave.
I think that in theory these should all follow some sort of $y=\frac{1}{x^c}$ distribution, where $x$ is partial number. If so, what would $c$ be for each of these?
Assume that it is easy enough to just set the even harmonics to null when needed. I think the pulse will be hard to predict too. But I figure the active saw/triangle/square partials should have pretty simple governing relationships.
Any help is appreciated. Thanks.

Update:
In response to Matt's suggestion to look at the Fourier series, I did so, and I think I have the solutions for all but the pulse.
1) Triangle
Fourier series: https://mathworld.wolfram.com/FourierSeriesTriangleWave.html
Amplitude: $y=\frac{1}{n^2}$ for odd partials, even partials are zero
2) Square
Fourier series: https://mathworld.wolfram.com/FourierSeriesSquareWave.html
Amplitude: $y=\frac{1}{n}$ for odd partials, even partials are zero
3) Sawtooth
Fourier series: https://mathworld.wolfram.com/FourierSeriesSawtoothWave.html
Amplitude: $y=\frac{1}{n}$ for all partials
4) Pulse
Fourier series: https://lpsa.swarthmore.edu/Fourier/Series/ExFS.html#EvenPulse
This becomes complex once it's no longer a 50% duty cycle square and I'm not sure what that amplitude expression would be though I'd love to know.
Did I get that right and if so, any thoughts on the pulse?
This is what Fourier series are all about. Under relatively mild conditions, a $T$-periodic function $f(t)$ can be represented as an infinite sum of complex exponentials:
$$f(t)=\sum_{k=-\infty}^{\infty}c_ke^{j2\pi kt/T}\tag{1}$$
Note that if $f(t)$ is real-valued, $(1)$ can equivalently be written as a sum of real-valued sinusoids:
$$f(t)=c_0+2\sum_{k=1}^{\infty}|c_k|\cos\left(\frac{2\pi kt}{T}+\phi_k\right)\tag{2}$$
with $c_k=|c_k|e^{j\phi_k}$. From $(2)$ it should be clear that not only the amplitudes $2|c_k|$ of the individual sinusoids but also the phases $\phi_k$ are important.
The complex Fourier coefficients $c_k$ are given by
$$c_k=\frac{1}{T}\int_{0}^{T}f(t)e^{-j2\pi kt/T}dt\tag{3}$$