fork download
  1. function f(c,x)
  2. b=(1:c).^x;d=bsxfun(@plus,b,b');d(d>c^x)=0;[~,r]=max(d(:));sprintf('%i^%i + %i^%i < %i^%i',[mod(r-1,c)+1 ceil(r/c) c;x x x])
  3.  
  4. end % needed in online interpreter only
  5.  
  6. f(8,3)
Success #stdin #stdout 0.17s 65056KB
stdin
Standard input is empty
stdout
ans = 7^3 + 5^3 < 8^3