There’s something wonderfully unsettling about a function that has no tangent anywhere, no matter how far you zoom in.
#!/usr/bin/env python3
import numpy as n,matplotlib.pyplot as p
a=.5;b=11;n_terms=50
x=n.linspace(-2,2,20000)
f=sum(a**k*n.cos(b**k*n.pi*x) for k in range(n_terms))
p.plot(x,f,'b',lw=.1)
p.title('Weierstrass Function')
p.grid()
p.show()









