#JavaScript (ES7), 77 76 bytes
Takes input as a string.
f=(n,k)=>([...[k*k]+k**3].sort()+f).match([...n].sort().join`.*`)?k:f(n,-~k)
#JavaScript (ES7), 77 76 bytes
Takes input as a string.
f=(n,k)=>([...[k*k]+k**3].sort()+f).match([...n].sort().join`.*`)?k:f(n,-~k)