# Revision history [back]

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

var('m'); var('j'); f=moebius(j) sum(f,j,0,m)

TypeError Traceback (most recent call last) <ipython-input-1-29d7fd7804be> in <module>() 1 var('m'); 2 var('j'); ----> 3 f=moebius(j) 4 sum(f,j,Integer(0),m)

/home/sc_serv/sage/local/lib/python2.7/site-packages/sage/rings/arith.pyc in __call__(self, n) 3831 n = -n 3832 F = factor(n) -> 3833 for _, e in F: 3834 if e >= 2: 3835 return 0

TypeError: 'sage.symbolic.expression.Expression' object is not iterable

 2 No.2 Revision vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

var('m'); var('j');

sage: var('m')
sage: var('j')
sage: f=moebius(j)
sage: sum(f,j,0,m)    TypeError                                 Traceback (most recent call last)
<ipython-input-1-29d7fd7804be> in <module>()
1 var('m');
2 var('j');
....
----> 3 f=moebius(j)
4 sum(f,j,Integer(0),m) /home/sc_serv/sage/local/lib/python2.7/site-packages/sage/rings/arith.pyc in __call__(self, n)
3831                 n = -n
3832             F = factor(n)
-> 3833             for _, e in F:
3834                 if e >= 2:
3835                     return 0 sum(f,j,Integer(0),m)
...
TypeError: 'sage.symbolic.expression.Expression' object is not iterableiterable

 3 No.3 Revision vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

sage: var('m')
sage: var('j')
sage: f=moebius(j)
sage: sum(f,j,0,m) f = moebius(j)
TypeError                                 Traceback (most recent call last)
....
----> 3 f=moebius(j)
4 sum(f,j,Integer(0),m)
...
TypeError: 'sage.symbolic.expression.Expression' object is not iterable

 4 No.4 Revision vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

sage: var('j')
sage: f = moebius(j)
TypeError                                 Traceback (most recent call last)
....
----> 3 f=moebius(j)
4 sum(f,j,Integer(0),m)
...
TypeError: 'sage.symbolic.expression.Expression' object is not iterable

 5 retagged vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

sage: var('j')
sage: f = moebius(j)
TypeError                                 Traceback (most recent call last)
....
----> f=moebius(j)
...
TypeError: 'sage.symbolic.expression.Expression' object is not iterable

 6 retagged FrédéricC 5127 ●3 ●42 ●111

### Mertens Function Error

I am new to Sage, so I suppose the answer to this is ridiculously obvious, but please go easy on me!

I have an error when I try to get Mertens function as an output yet: I know the summation works for other functions; and I know the Moebius function is defined on the range. So what's going on?

This is the input and output:

sage: var('j')
sage: f = moebius(j)
TypeError                                 Traceback (most recent call last)
....
----> f=moebius(j)
...
TypeError: 'sage.symbolic.expression.Expression' object is not iterable