Let's determine the coefficients $A$ and $B$ such that the polynomial

$$
A x^{n+2}+B x^{n+1}+x-1
$$

is divisible by $(x-1)^{2}$.
First, we establish the condition for divisibility by $x-1$. Our polynomial can be written as:

$$
f(x)=\left(A x^{n+2}-A\right)+\left(B x^{n+1}-B\right)+(x-1)+(A+B)
$$

Here, the first three binomial expressions are divisible by $x-1$, because

$$
\begin{gathered}
A\left(x^{n+2}-1\right)=A(x-1)\left(x^{n+1}+x^{n}+x^{n-1}+\ldots+x+1\right) \\
B\left(x^{n+1}-1\right)=B(x-1)\left(x^{n}+x^{n-1}+\ldots+x+1\right)
\end{gathered}
$$

Therefore, $f(x)$ will be the product of $x-1$ and another polynomial if and only if the remainder, i.e., the fourth binomial, disappears:

$$
A+B=0, \quad \text { i.e., } \quad B=-A
$$

In this case, the quotient of $f(x)$ when divided by $(x-1)$, based on (1) and (2), is

$$
\begin{gathered}
A\left(x^{n+1}+x^{n}+\ldots+x+1\right)+B\left(x^{n}+x^{n-1}+\ldots+x+1\right)+1= \\
=A\left(x^{n+1}+x^{n}+\ldots+x+1\right)-A\left(x^{n}+x^{n-1}+\ldots+x+1\right)+1=A x^{n+1}+1
\end{gathered}
$$

$f(x)$ will be divisible by $(x-1)^2$ if and only if this quotient is also divisible by $x-1$. However,

$$
\begin{gathered}
A x^{n+1}+1=\left(A x^{n+1}-A\right)+(A+1)=A(x-1)\left(x^{n}+x^{n-1}+\ldots+x+1\right) 1+ \\
+(A+1)
\end{gathered}
$$

and thus the condition for divisibility, applying the previously mentioned principle again, is

$$
A+1=0, \quad \text { i.e., } \quad A=-1, \quad \text { and } \quad B=1
$$

Accordingly, the desired form of the polynomial is:

$$
x^{n+2}+x^{n+1}+x-1
$$

Pál Loparits (Budapest, Széchenyi I. g. III. o. t.)

Remark. We can arrive at the condition $A+B=0$ more simply. If the condition of the problem is satisfied, then $f(1)=0$. But $f(1)=A+B+1-1=A+B$, so $A+B=0, B=-A$.