Re: skipping some i, j , ... values in Table
- To: mathgroup at smc.vnet.net
- Subject: [mg130830] Re: skipping some i, j , ... values in Table
- From: spamslayer19 at gmail.com
- Date: Sun, 19 May 2013 05:48:31 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <kn77l0$8is$1@smc.vnet.net>
Others will chime in with more elegant solutions, but I believe this does what you wanted:
f @@@ Select[
Flatten[Table[{i, j}, {i, 1, 10}, {j, 1, 10}],
1], ! PrimeQ@(Plus @@ #) &]
That gives a list of f[i,j] where i+j aren't prime.
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