list = {2}; Do[ prod = Times @@ list; prod++; new = Min[FactorInteger[prod][[All, 1]]]; AppendTo[list, new] , {21 - 1} ]; list