OFFSET
1,2
COMMENTS
The primes may not be in order. a(3) = 7, but the three primes are 2, 3, and 7.
MATHEMATICA
r = 0;
s = Array[-1 + CountDistinct@ Rest@ NestWhileList[{#1 - #1/#2, #2} & @@ {First[#], FactorInteger[First[#]][[1, 1]]} &, {#, #}, Last[#] > 1 &][[All, -1]] &, 2^16, 2];
{1}~Join~Reap[Do[If[# > r, r = #; Sow[i + 1]] &[s[[i]]], {i, Length[s]}] ][[-1, 1]] (* Michael De Vlieger, Nov 08 2023 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Robert G. Wilson v, Oct 31 2023
STATUS
approved