Answer by WReach for How to iteratively build a list?
The GeneralUtilities`` package contains undocumented iterator functionality that resembles the generator-based iterators from C++. Perhaps these will make it into the core language some day. Until...
View ArticleAnswer by halirutan for How to iteratively build a list?
Let me see if I get this right. So you havemax = 10^12and you are iterating over the same list of primes with a nested loop. Your inner loop iterates over q and we should first calculate the largest...
View ArticleHow to iteratively build a list?
I have the following c++ code that I want to translate to Mathematica.std::vector<int> squbes;for (int p : primes) for (int q : primes) if (p != q){ if (p*p*q*q*q > maxi) break;...
View Article