Ask Your Question

Summing with Euler_phi Error

asked 2013-07-10 11:29:53 +0200

david8381 gravatar image

New to sage, having some trouble with summation.

z, k both declared as variables.


Error: not an integer argument in an arithmetic function (18) If I change it to euler_phi(5)/5 it's fine.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-10 11:39:36 +0200

vdelecroix gravatar image

I guess this is because euler_phi does not accept symbolic argument

sage: var('z')
sage: euler_phi(z)
Traceback (most recent call last):
PariError: not an integer argument in an arithmetic function (18)

Nevertheless, you can do

sage: sum((euler_phi(k)/k)*log(1/(1-2*z^k)) for k in xrange(2,5))
1/2*log(-1/(2*z^4 - 1)) + 2/3*log(-1/(2*z^3 - 1)) + 1/2*log(-1/(2*z^2 - 1))
edit flag offensive delete link more


kcrisman gravatar imagekcrisman ( 2013-07-10 11:45:45 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-07-10 11:29:53 +0200

Seen: 223 times

Last updated: Jul 10 '13