So as we all know, all primes fall within the domain of 6 plus or minus 1, which I produced a list of candidates for as "c" by way of the code below.
n = Range[50];
u = 6 n - 1;
v = 6 n + 1;
c = Sort[Join[u, v]];
How could I exclude all numbers in c
greater than 5 for which $c~\textrm{mod}_5 = 0$ (e.g., 25)? This should be easy!
At first I tried conditional expressions but it seemed it would not print because there was an element in the set like 25 that met the condition, so maybe what I'm looking for is something with Except, but I need 5 included.
Cases[c, a_ /; Mod[a, 5] != 0 || a == 5]
$\endgroup$ – march Sep 26 '16 at 21:08Pick[c, c/5, Except[Except[1,_Integer]], {1}]
might work $\endgroup$ – LLlAMnYP Sep 27 '16 at 7:31