Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14535

Re: skipping some i, j , ... values in Table

From spamslayer19@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: skipping some i, j , ... values in Table
Date 2013-05-19 09:46 +0000
Message-ID <kna72f$fvr$1@smc.vnet.net> (permalink)
References <kn77l0$8is$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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 UTC-5, 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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

skipping some i, j , ... values in Table Andre Hautot <ahautot@ulg.ac.be> - 2013-05-18 06:38 +0000
  Re: skipping some i, j , ... values in Table spamslayer19@gmail.com - 2013-05-19 09:46 +0000
  Re: skipping some i, j , ... values in Table spamslayer19@gmail.com - 2013-05-19 09:46 +0000

csiph-web