RosettaCodeData/Task/Loops-Increment-loop-index-within-loop-body/Mathematica/loops-increment-loop-index-within-loop-body.math

9 lines
104 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
{i, n} = {42, 0};
While[n < 42,
If[PrimeQ[i],
Print["n=", n++, "\t", i];
i += i - 1;
];
i++;
]