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