Question: new user observation - quotes

I was trying to do something that I thought would be really simple - without success - then it occurred to me what was missing... a couple of quotes. There's other ways to do the same thing, but this is just the way I was trying to do it. sum all primes up to a certain count. ithprime returns prime up to cnt ( no quotes required ) no quotes required -- sum(ithprime(b), b = 1 .. 5)  #adds 2,3,5,7,11 sum all primes up to a certain number. quotes are required -- tprime := proc (s) if isprime(s) then s else 0 end if end proc sum('tprime(n)', n = 1 .. 12)  #adds 2,3,5,7,11 else, with: sum(tprime(n), n = 1 .. 12) Error, (in tprime) cannot determine if this expression is true or false: isprime(n) Below is a link showing this in HTML. There is a link at the top of the HTML to download the Maple 11 worksheet. HTML example with link to worksheet
Please Wait...