Let Q be a computational problem that accepts as input some $n$ non-negative integers. Is it possible (assuming $P\neq NP$) that Q is NP-hard in general, but can be solved in polynomial time when restricted to inputs in the range $[0,2^n]$?
If, instead of $2^n$, there was any function that is polynomial in $n$, then the answer would be "yes", as there are many NP-hard problems that can be solved in pseudo-polynomial time, such as the knapsack problem.
For some specific NP-hard problems, the question is "no". For example, it is easy to prove that the Partition problem is NP-hard even when restricted to inputs in $[0,2^n]$, as we can always add zeros without changing the outcome, such that $n$ becomes equal to $\log_2$ of the largest integer in the input. But I am not sure if this trick works for other problems.
Is it possible in general?