First time here? Check out the FAQ!

Ask Your Question
0

Summing with Euler_phi Error

asked 11 years ago

david8381 gravatar image

New to sage, having some trouble with summation.

z, k both declared as variables.

sum((euler_phi(k)/k)log(1/(1-2z^k)),k,2,5)

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 11 years ago

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))
Preview: (hide)
link

Comments

1

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 308 times

Last updated: Jul 10 '13