Skip to main content
2 of 2
added 152 characters in body
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 62 60 bytes

function(n,y=outer(1:n,2:n,"^"))c(max(y[y<=n]),min(y[y>=n])) 

Try it online!

Brute force approach: generate all powers of 1..n raised to 2..n and find and return least upper bound and greatest lower bound.

Giuseppe
  • 29.4k
  • 3
  • 33
  • 106