Polydivisible.search is currently noticably slow for bases with high prime factors. This is because the search space for each digit is dependent on the gcd of the current divisor and the base.
An (efficient) way to reduce the search space would significantly improve performance.
The divisible method is the biggest bottleneck in the current algorithm so speedup here would have the next greatest impact.
Polydivisible.search
is currently noticably slow for bases with high prime factors. This is because the search space for each digit is dependent on thegcd
of the currentdivisor
and thebase
.An (efficient) way to reduce the search space would significantly improve performance.
Thedivisible
method is the biggest bottleneck in the current algorithm so speedup here would have the next greatest impact.