# Tag Info

### Optimize search for rational numbers on unit circle?

This method is called the Stereographic approach and can be used to generate arbitary rational triples without needing brute force searching. I was fortunate to have learned this trick off Minhyong ...
• 21.7k

### Optimize search for rational numbers on unit circle?

This is a compiled program to find all Pythagorean triples $(a,b,c)$ with $a^2 + b^2 = c^2$ and $a \leq b$ and where c lies between ...
• 98.3k
Accepted

### Memory leak with Mathematica Graph functions

Here is another possible way to eliminate the impact of history, etc. The following code aborts on my machine after printing to the console three times. ...
• 4,753
Accepted

### NDSolve very slow on 2D heat equation

The simplest solution I find is, add SolveDelayed -> True to NDSolve: ...
• 58.5k
Accepted

### Speed up replacement of very large alternatives expression

Use threaded rules instead of alternatives: instead of 1 | 2 -> 0 use {1 -> 0, 2 -> 0}. Combined with a ...
• 40.1k

### What is a good way to compute successive primorials with Mathematica?

Mathematica code is already provided in the The On-Line Encyclopedia of Integer Sequences, here http://oeis.org/A002110 oeis Sol 1 ...
• 33k
Accepted

### Optimize search for rational numbers on unit circle?

This is not the fastest solution in the world for finding rational points on the unit circle (takes 4.3 seconds on my laptop for denominators up to 100000), but at least it's short: ...
• 16.2k

### NDSolve very slow on 2D heat equation

Try FiniteElement method with NeumannValue instead of derivative-bc: ...
• 41.5k

### What is a good way to compute successive primorials with Mathematica?

Luckily Prime is Listable and we can make an elegant solution with FoldList: ...
• 7,754

### What is a good way to compute successive primorials with Mathematica?

Not sure if the following is considered a good way, but at least it gave results in realistic time frames and did not crash anything. Create the list of primes and then multiply the elements of the ...
• 9,067
Accepted

• 33k
Accepted

### NIntegrate: slow convergence error and speed efficiency

If we change the method of integration, we can obtain the NNt[1,1] which we see in the screenshot without any errors. The method is ...
• 9,067
1 vote

### Quickly summing matrix elements

One possibility is to use TensorContract/TensorProduct, but you need to also use Inactive to ...
• 126k
1 vote

### Efficient memory usage while building a large sparse matrix

Even though you have shared no details about f, as others have mentioned, I think I understand your problem. Consider this (note that ...
• 4,753
1 vote
Accepted

### How to refer to calling notebook instead of my personal include? / detector for high-memory-usage cells

The issue is that the default values EvaluationNotebook[] and EvaluationCell[] are evaluated when the function is defined, not ...
• 29.9k

Only top scored, non community-wiki answers of a minimum length are eligible