Calculate factorbase.