JavaScript (Node.js), 63 bytes
f=(n,m=2,i=0,p=n-i**m)=>p<0?f(n,m+1):!p||i&&f(p)<m?m:f(n,m,i+1)
Time out for not so large n as its terrible recursion design. It could be fast if we apply memorize to it (70 bytes).
f=(n,m=2,i=0,p=n-i**m)=>f[n]??=p<0?f(n,m+1):!p||i&&f(p)<m?m:f(n,m,i+1)
o.value = [...Array(50000)].map((_, i) => i).filter(v => f(v) > 5).join(', ')
<a href="https://oeis.org/A111151">A111151</a>: <output id=o></output>