# Computer Algebra Errors

In the course of doing mathematics, I make extensive use of computer-based calculations. There's one CAS that I use mostly, even though I occasionally come across out-and-out wrong answers.

After googling around a bit, I am unable to find a list of such bugs. Having such a list would help us remain skeptical and help our students become skeptical. So here's the question:

What are some mathematical bugs in computer algebra systems?

Please include a specific version of the software that has the bug. Please note that I'm not asking for bad design decisions, and I'm not asking for a discussion of the relative merits of different CAS's.

• Judging by the answers below, maybe a better question would be not "What are some bugs?" but "Which websites have the most useful/comprehensive lists of bugs?". – David E Speyer Jan 12 '10 at 15:36
• This is possibly some sort of record: Richard Parker told me that he once typed "isprime(2)" as his first ever query to a certain computer algebra system, and got the reply "2 is not prime". He also claimed, probably correctly, that he could find a bug in any computer algebra system within 5 minutes. – Richard Borcherds Aug 9 '10 at 14:27
• Richard's story is really surprising, because all systems I know will look up small primes in a table, so someone left off 2 from that table. It's possible, I guess, but really a silly goof. – Thierry Zell Apr 27 '11 at 16:51
• Kevin thanks. pari has unconditional thue solver too (the second thue() in the example) and it agrees with your solutions. pari's GRH conditional solver is faster than the unconditional (in some cases the unconditional might be undoable). Do you happen to know other GRH conditional thue solver implementation? – joro Jul 13 '12 at 5:19
• RE: GRH thue solver. Pari developers are investigating the problem. The thread is here: pari.math.u-bordeaux.fr/archives/pari-dev-1207/msg00008.html. Developer wrote "I do not understand where the problem (missing solution) comes from yet. It looks like a mathematical bug so far...". The pari thue code is relatively small. – joro Jul 16 '12 at 5:46

According to Wolfram Alpha

$$(\log{(5+i)}+\log{(5-i)})^4= 10\,000$$

When one clicks on "10 000" WA spells it as integer.

Mathematica 7.0.1 says that Sum[1/(k*Length[Divisors[k]]), {k, 1, n}] is the harmonic number $H_n$, which is clearly wrong. The correct answer is at An elementary number theoretic infinite series

## Edit:

This is less a bug and more a misunderstanding of how to use Mathematica. The culprit is that Length[Divisors[k]] for k without a value evaluates to 1 (which is consistent with how Mathematica structurally treats expressions). The correct way to express the sum is

Sum[1/(k DivisorSigma[0, k]), {k, 1, n}]


which, as expected, now remains unevaluated.

http://oeis.org/A110375

A110375   Numbers n such that Maple 9.5, Maple 10, Maple 11 and Maple 12 give the wrong answers for the number of partitions of n.

Not a bug but a difficulty for users:

I do often not really understand how assignements work for CAS:

Given a variable $a$ with value, say, $\pi$, set $b:=a$ and set now $a$ to, say, $e$. What is the value of $b$?

As I understand the answer depends sometimes on the context (working with symbolic variables, vectors, floating numbers etc.) and the exact behaviour is sometimes difficult to guess for me.

• Normally this should not be a matter of guessing. Somewhere the documentation should state whether the evaluation is call-by-value ($b=\pi$) or call-by-reference ($b=e$). – darij grinberg Apr 27 '11 at 9:02
• Maple and Mathematica are both call-by-value. What Roland is probably referring to is that Maple has some variables which have an entirely 'new' calling convention,last-name-evaluation: a cross between call-by-value and call-by-name. An LNE variable (like a table) will 'evaluate' all the way to a value and then BACKTRACK one level and return the last name encountered! The reason for this is purely for display purposes, as the name is preferred over a large value. This decision was made in 1982 (or so), when it made some sense, but now Maple is stuck with this. MMA has similar oddities too – Jacques Carette Apr 27 '11 at 12:46
• I would be great to leave the choice to to the user! – Roland Bacher Apr 27 '11 at 13:45
• @Roland, the problem with leaving the choice to the user would be that the same program would give different results for different users. – Joel Reyes Noche Apr 28 '11 at 1:04
• Of course! Passing By Reference or Passing By Value?. One of the classes in your programming courses, though not the first one indeed..... – Brethlosze May 18 '17 at 2:14