This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingPrecompute smallest prime factors, then factor many queries fast.
What this asks
Answer many factoring questions after one preprocessing pass.
Precompute the smallest prime factor of every value up to the limit, then hop factor to factor.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing