If I have a large number, for example,
2^11 is there code to list a table of positive integers less than this number which are not of the form
p^k *j where $p$ is prime and $j\not=p$ is either prime or 1?
Update: The restriction
p^k * j < 2^11 forces (in case j=1)
p^k < 2^11 for each given p. So for each $p$, the largest $k$ (let's denote it $k_p$) for which $p^{k_p}<2^{11}$ is $k_p=$
Floor[11 Log[2] / Log[p]]
k? $\endgroup$Pick[#, Not[PrimeQ[FactorInteger[#, 2][[-1, 1]]]] & /@ #] &@ Range[2^11]? $\endgroup$