Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



calculating euler products [newbie]
Posted:
Jan 5, 2012 12:35 PM


I've written the function below to calculate eulerproducts, I was wondering how it can be improved i.e. written more in "matlabstyle" perhaps reducing execution time for large numbers
regards, Jean
function eulerprod(n) %calculate PI(1/(1p^1)) for all primes smaller than n prime=primes(n); nop=length(prime) factor=1 for i=1:nop factor=factor/(1prime(i)^(1)); y(i)=factor; end plot([1:nop],y)



