How do I make the slider values in Manipulate be values that are prime numbers? Many thanks for any assistance.
Firstly, many thanks for all your considered and rapid responses. It really is very much appreciated. Here is my Mathematica 'code' to produce some tables that demonstrate a small Lemma about residue classes. In the last section I am seeking that the p-input variable only selects primes.
Manipulate[{MatrixForm[Table[x + y p^(r - 1 - t), {x, 0, p^t - 1}, {y, 0, p - 1}]], MatrixForm[Table[Mod[x + y p^(r - 1 - t), p^t], {x, 0, p^t - 1}, {y, 0, p - 1}]], Transpose[Table[Sort[Table[Mod[x + y p^(r - 1 - t), p^t], {x, 0, p^t - 1}, {y, 0, p - 1}][[All, i]]], {i, 1, p}]] // MatrixForm},
{p, 2, 100, 1}, {r, 1, 10, 1}, {t, 0, r - 1, 1}]
Just as a side-bar, sorting the individual matrix columns was difficult for me with no easy global sort function (like Excel) readily available. Cheers.
TrackingFunction
, and replace controlling ofp
with{p, 2, 100, 1, Appearance->"Labeled", TrackingFunction -> (If[PrimeQ[#], p=#]&)}
. $\endgroup$ – BoLe Jul 31 '16 at 7:37