# Plot of Fourier series involving prime

So, I was playing with Fourier series just for fun and got a weird idea.

I'm sure that someone have think of this series before

$$f(x) = \displaystyle\sum_{n=1}^{\infty} {{\frac {(-1)^n} {p_n}}\sin(p_nx)}$$

Where $$p_n$$ is the n-th prime number

This is the plot involving first 20 prime numbers using desmos.

I have 2 questions regarding this series.
1. Is this plot smooth and/or analytics in the limit?
2. Does anyone know how to plot this function?

I try using python, but couldn't really figure out how to do it.

• I think that what you plotted is $$f(x) = \displaystyle\sum_{n=1}^{\infty} {{\frac {(-1)^{n+1}} {p_n}}\sin(p_nx)}$$ Why not to rescale the plot to make it nicer (say $y$ values between $-1.2$ and $1.2$). ?$Interesting problem Aug 5, 2022 at 7:36 • I tried with the first$10,000\$ first prime numbers. It does not change much (as we can expect). Aug 5, 2022 at 7:55
• What could be interesting would be remove the noise from the signal. Have a look at medium.com/analytics-vidhya/… Aug 5, 2022 at 8:56

Plot[Sum[((-1)^(1 + n)*Sin[x*Prime[n]])/Prime[n], {n, 1, p}],{x,-2Pi,2Pi}]
Give $$p$$ the value you want