I need an algorithm in Mathematica, which can represent any very long integer, prime or not, into the the product operation "*" and sum "+" forms by short integers (not more than 8 decimal digits).
Additional rules on the final expression of the very long integer are:
(1). the lengths (base-10 decimal digits) of all short prime integers employed should be as close to 6 as possible, the closer the better;
if there are n different short integers used, we use the sum of squared differences between their lengths and 6 as the criterion: the smaller the better (first priority);
(2). the less "+" operators used the better (second priority); the less "*" the better(the third priority).
The final expression of the integer should be usable immediately in C/C++.
Example numbers for testing:
29427736469514379027531261659072347 58899562724319710108573382000184640 1732944474195510410991057714955859184
Is there any Mathematica implementation of such algorithm?