The reason I am doing this is to find a closest number higher than N, which is a common multiple of prime powers --- to be able to use FFTW.
As I understand this is an optimization/linear programming problem. And I managed to formulate the mathematically:
minimize(a log(2) + b log(3) + c log(5) + ...)
Constraints::
a log(2) + b log(3) + c log(5) + ..... >= log (N) (known parameter: N)
{a, b, c ...} >= 0 (i.e. are positive)
{a, b, c ...} % 1 == 0 (i.e. are integers)
where a, b, c are the exponents and are integers.
I would like to implement the same numerically. Preferably using scipy.optimize
.
EDIT: I have modified the equations slightly based on comments. Even if an implementation does not exist, an algorithm would be helpful.