5 ms·
That would be Sage, but (and I say this as somebody who uses Sage wherever possible) it's light years behind Mathematica and always will be. Do you want to be t
by hyperbovine 12y ago
That would be Sage, but (and I say this as somebody who uses Sage wherever possible) it's light years behind Mathematica and always will be. Do you want to be the guy in charge of implementing all of the incredibly complicated functionality in Mathematica? Or even better, writing quality documentation for all of it, which Mathematica has? There is a lot of software out there for which the intersection of the people who possess the technical knowledge to write it correctly, and the people who are willing to do so for free, is empty. (In the cases where it's not, we call those "graduate students" :)
- AnimalMuppet 12y agoGreat, but if Mathematica has also not written it correctly, then what? The fact that Mathematica has it and Sage doesn't is irrelevant, if Mathematica has it wrong.
- octonion 12y agoI just used Sage to find all sets of 1 quadrillion positive integers that have the same product and sum. Feel free to try that in Mathematica.
- jessaustin 12y agoIs this a finite set? If so, what's the simplest way to show this?
- octonion 12y agoI came up with my own algorithm and found several speedups, but I haven't written an expanded article yet. I've implemented it in Julia, but Julia's built-in factoring is (unfortunately) far slower than Sage's. A short preliminary article: http://angrystatistician.blogspot.com/2014/08/learn-this-one-weird-trick-and-easily.html http://angrystatistician.blogspot.com/2014/08/learn-this-one... Here's the Sage code: https://github.com/octonion/puzzles/tree/master/product-sum https://github.com/octonion/puzzles/tree/master/product-sum I'd be curious to see the speed of the corresponding Mathematica or Maple code.
- kgwgk 12y agoThe Mathematica code below is roughly comparable to your vanilla version. Using a 2013 iMac (3.2 GHz Intel Core i5) I get the following timings for Sage/Mathematica (Mathematica gets more competitive for larger problems): 10^8 22s 65s 10^9 225s 635s 10^11 14h20 16h05 However, I found that Sage seems to calculate divisors faster than Mathematica for large numbers. The following are the times to sum the divisors of one million numbers starting at 10^8, 10^9, 10^10, 10^11: Sage: 18s, 21s, 24s, 27s Mathematica: 12s, 14s, 28s, 49s Solutions[pSum_, pProd_] := With[{term = 1 + pSumpProd}, With[{div = Divisors[term]}, Map[Function[x, If[Mod[x + 1, pProd] == 0, (1 + {x, term/x})/pProd, ## &[]]], Take[div, Ceiling[Length[div]/2]]]]] WithNonOneValues[n_, nval_] := Last[Reap[If[nval == 0, Sow /@ Solutions[n - 2, 1], Module[{val = Array[2 &, nval], idx = 1}, While[idx <= nval, With[{pSum = Plus @@ val + n - nval - 2, pProd = Times @@ val}, If[pSum + 2val[[1]] < pProd*val[[1]]^2, If[(++idx) <= nval, val[[Range[idx]]] = val[[idx]] + 1], Map[Function[x, If[Min[x] >= val[[1]], Sow[Flatten[{x, val}], ## &[]]]], Solutions[pSum, pProd]]; idx = 1; val[[1]] = val[[1]] + 1]]]]]]] AllSolutions[n_] := Flatten[Map[Function[x, WithNonOneValues[n, x]], Range[0, Log2[n]]], 2]
- jasongrout 12y agoAt least for this research, Sage may have been better. This code follows the random matrix example to show that Sage gives at least consistent results in one of the cases they pointed out. Here's the public SageMathCloud worksheet: https://cloud.sagemath.com/projects/49a2531d-9d02-42c9-9db6-f9551fbfa59e/files/2014-10-24-212837.sagews https://cloud.sagemath.com/projects/49a2531d-9d02-42c9-9db6-... I wish they would have supplied those matrices they printed out in machine-readable format so we could easily put those in Sage too.
- williamstein 12y agoHere's another worksheet with some symbolic integrals from the article: https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/ams-article-mathematica-bugs.sagews https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-... I wrote the det code in Sage that you're calling there (though in Sage-6.4 it'll likely be replaced by a call to FLINT). It computes det(A) in a very interesting way, which is asymptotically massively faster than Mathematica. To compute det(A), choose a random vector v and solve Ax = v using a p-adic lifting algorithm (the one in https://cs.uwaterloo.ca/~astorjoh/iml.html https://cs.uwaterloo.ca/~astorjoh/iml.html). One can prove --using Cramer's rule--that the lcm of the denominators of the entries of x will then be a divisor d of det(A), and with high probability one expects that det(A)/d is a tiny integer. One can then provably (using the Hadamard bound) find det(A) by working modulo a few additional primes and using the Chinese Remainder theorem.
- judk 12y agoMagma gets massive funding from Simons Foundation. It is a shame to have all that money donated to nonfree software program, really.
- octonion 12y agoI couldn't agree more. A terribly wasted opportunity.
- EdwardDiego 12y agoIt doesn't have to be free (as in beer) to have source code available. But it does require some out of the box thinking from the vendor - I deal with one licensed product, and they won't give us source code for the JDBC drivers. It's a JDBC driver! It's not doing anything revolutionary, it has nothing to do with the core competitive advantage of your product, ffs.