[boost] New Number theory algorithm