Plot of Fourier series involving prime

81 Views Asked by At

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.

enter image description here

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.

1

There are 1 best solutions below

1
On BEST ANSWER

For the plot, use the following input in Wolfram Alpha

Plot[Sum[((-1)^(1 + n)*Sin[x*Prime[n]])/Prime[n], {n, 1, p}],{x,-2Pi,2Pi}]

Give $p$ the value you want