> > in Mathematica (and maybe something like it in Sage). > > Expand[(x^(2^(2^29))+1)^2]
Sage uses Ginac/Pynac for this. It just hangs: sage: expand((x^(2^(2^29))+1)^2) ^C ------------------------------------------------------------ Unhandled SIGSEGV: A segmentation fault occurred in Sage. This probably occurred because a *compiled* component of Sage has a bug in it (typically accessing invalid memory) and is not properly wrapped with sig_on(), sig_off(). You might want to run Sage under gdb with 'sage -gdb' to debug this. Sage will now terminate (sorry). ------------------------------------------------------------ Here is Maxima. Maxima 5.22.1 http://maxima.sourceforge.net using Lisp ECL 10.4.1 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) expand((x^(2^(2^29))+1)^2); Maxima encountered a Lisp error: Memory limit reached. Please jump to an outer pointer, quit program and enlarge the memory limits before executing the program again. Automatically continuing. To enable the Lisp debugger set *debugger-hook* to nil. For obvious reasons, I guess. Too bad one couldn't just let it remain completely symbolic... sage: var('a,b,c') (a, b, c) sage: z = (x^(2^(2^c))+1)^2 # fine so far :) sage: for i in range(30): ....: print i ....: z.subs(c=i) ....: gives some lovely output, but as far as I can tell you don't even have to expand in Pynac to cause this - nor in Maxima. But it is a shame that even though expand does have a sig_on around the Ginac piece, it still doesn't seem to fail as quickly as Maxima - which to my mind is not a feature, either; if it's too big for memory, it should let us know that nice and quickly. - kcrisman -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org