Мдааа неделя жесткой работы и никаких улучшений :(
Теперь думаю как можно обойтись без больших чисел? Самое лучшее что придумал это использовать логарифмы и правило
. Но не знаю что делать дальше.
For n=16 and n=17 I find solutions which are better than the trivial solution just by exhausting s^n with k^n with k<n, starting with k=n-1 and working down to k=1.
I work with Delphi and use an arbitrary precision integer package. It works well for really big numbers. So within a few minutes I get for example
10000^10=>{9999, 5011, 2576, 1387, 840, 494, 325, 234, 159, 119, 100, 80, 68, 58, 52, 48, 45, 38, 32, 28, 27, 26, 25, 19, 18, 16, 15, 12, 11, 9, 8, 7, 5, 4, 2, 1}
100000^10=>{99999, 39810, 16333, 5195, 2646, 1125, 664, 341, 214, 172, 134, 104, 86, 76, 66, 60, 52, 45, 43, 37, 32, 30, 28, 27, 23, 22, 20, 18, 15, 14, 11, 9, 8, 7, 4, 3, 2, 1}
100000^10=>{99999, 39810, 16333, 5195, 2646, 1125, 664, 340, 244, 197, 148, 113, 52, 46, 41, 36, 33, 30, 28, 27, 26, 25, 24, 23, 21, 20, 19, 18, 15, 14, 13, 12, 10, 7, 4}
with an error of 0.
So I do not believe that it is necessary to work with reals and the log function.