I was wondering how one can represent a sum in python without loops like here
where we have:
def rosen(x):
"""The Rosenbrock function"""
return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)
My function is the following: V(theta) = Sum(i=1->N)[a0*(cos(i*theta)]
Thank you in advance for your help :):)