  B\"uchi's $n$ Squares Problem asks for an integer $M$ such that any sequence
$(x_0,...,x_{M-1})$, whose second difference of squares is the constant
sequence $(2)$ (i.e. $x^2_n-2x^2_{n-1}+x_{n-2}^2=2$ for all $n$), satisfies
$x_n^2=(x+n)^2$ for some integer $x$. Hensley's problem for $r$-th powers
(where $r$ is an integer $\geq2$) is a generalization of B\"{u}chi's problem
asking for an integer $M$ such that, given integers $\nu$ and $a$, the quantity
$(\nu+n)^r-a$ cannot be an $r$-th power for $M$ or more values of the integer
$n$, unless $a=0$. The analogues of these problems for rings of functions
consider only sequences with at least one non-constant term. Let $K$ be a
function field of a curve of genus $g$. We prove that Hensley's problem for
$r$-th powers has a positive answer for any $r$ if $K$ has characteristic zero,
improving results by Pasten and Vojta. In positive characteristic $p$ we obtain
a weaker result, but which is enough to prove that B\"uchi's problem has a
positive answer if $p\geq 312g+169$ (improving results by Pheidas and the
second author).
