RosettaCodeData/Task/Loops-Increment-loop-index-within-loop-body/Mathematica/loops-increment-loop-index-within-loop-body.math
2023-07-01 13:44:08 -04:00

8 lines
104 B
Text

{i, n} = {42, 0};
While[n < 42,
If[PrimeQ[i],
Print["n=", n++, "\t", i];
i += i - 1;
];
i++;
]