Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: skipping some i, j , ... values in Table
Posted:
May 19, 2013 5:46 AM


Here's another solution, slightly faster for large numbers:
Rest@Flatten@ Reap@Do[If[! PrimeQ@(i + j), Sow@f[i, j]], {i, 1, 10}, {j, 1, 10}]
On Saturday, May 18, 2013 1:38:24 AM UTC5, Andre Hautot wrote: > Hi, > > Suppose I need a list, Flatten[Table[something[i,j],{i,10},{j,10}]], > > where some combinations of indices i and j are voluntarily missing under > > a known condition (for example, stupid I know, when i+j is a prime). > > How can I do that ? > > Thanks in advance, > > ahautot



