How would you precalculate a big table of the biggest prime factor of every integer in $2 \dots 10^K$? The goal would be to do it once for all, save it to a file, and reload it later for fast computations (involving smooth numbers). I tried with R:
library(gmp) # the fastest factorization I've found on R, faster than number theory package "numbers" v = sapply(2:10^7, function(x) as.integer(max(factorize(x)))) save(v, file="bpf.dat")
allowing later to load it with:
But this is very slow (35 seconds for $K=6$, 390 seconds for $K=7$ , etc.). Which number-theoretic idea could be used to generate such a table faster?
Note: I've already looked at https://oeis.org/A006530.
Note2: This question has been removed in mathoverflow (because too obvious), but I wanted to post here question+answer thanks to the helpful comments that were provided.