# 2022 AMC 10B Problems/Problem 21

The following problem is from both the 2022 AMC 10B #21 and 2022 AMC 12B #20, so both problems redirect to this page.

## Problem

Let $P(x)$ be a polynomial with rational coefficients such that when $P(x)$ is divided by the polynomial $x^2 + x + 1$, the remainder is $x+2$, and when $P(x)$ is divided by the polynomial $x^2+1$, the remainder is $2x+1$. There is a unique polynomial of least degree with these two properties. What is the sum of the squares of the coefficients of that polynomial?

$\textbf{(A)}\ 10 \qquad\textbf{(B)}\ 13 \qquad\textbf{(C)}\ 19 \qquad\textbf{(D)}\ 20 \qquad\textbf{(E)}\ 23$

## Solution 1 (Experimentation)

Given that all the answer choices and coefficients are integers, we hope that $P(x)$ has positive integer coefficients.

Throughout this solution, we will express all polynomials in base $x$. E.g. $x^2 + x + 1 = 111_{x}$.

We are given: $$111a + 12 = 101b + 21 = P(x).$$ We add $111$ and $101$ to each side and balance respectively: $$111(a - 1) + 123 = 101(b - 1) + 122 = P(x).$$ We make the unit's digits equal: $$111(a - 1) + 123 = 101(b - 2) + 223 = P(x).$$ We now notice that: $$111(a - 11) + 1233 = 101(b - 12) + 1233 = P(x).$$ Therefore $a = 11_{x} = x + 1$, $b = 12_{x} = x + 2$, and $P(x) = 1233_{x} = x^3 + 2x^2 + 3x + 3$. $3$ is the minimal degree of $P(x)$ since there is no way to influence the $x$‘s digit in $101b + 21$ when $b$ is an integer. The desired sum is $1^2 + 2^2 +3^2+ 3^2 = \boxed{\textbf{(E)} \ 23}$

P.S. The four computational steps can be deduced through quick experimentation.

~ numerophile

## Solution 2

Let $P(x) = Q(x)(x^2+x+1) + x + 2$, then $P(x) = Q(x)(x^2+1) + xQ(x) + x + 2$, therefore $xQ(x) + x + 2 \equiv 2x + 1 \pmod{x^2+1}$, or $xQ(x) \equiv x-1 \pmod{x^2+1}$. Clearly the minimum is when $Q(x) = x+1$, and expanding gives $P(x) = x^3+2x^2+3x+3$. Summing the squares of coefficients gives $\boxed{\textbf{(E)} \ 23}$

~mathfan2020

## Solution 3

Let $P(x) = (x^2+x+1)Q_1(x) + x + 2$, then $P(x) = (x^2+1)Q_1(x) + xQ_1(x) + x + 2$

Also $P(x) = (x^2+1)Q_2(x) + 2x + 1$

We infer that $Q_1(x)$ and $Q_2(x)$ have same degree, we can assume $Q_1(x) = x + a$, and $Q_2(x) = x + b$, since $P(x)$ has least degree. If this cannot work, we will try quadratic, etc.

Then we get: $(x^2+1)(Q_1(x) - Q_2(x)) + xQ_1(x) - x + 1 = 0$

The constant term gives us: $(Q_1(x) - Q_2(x)) + 1 = 0$

So $Q_1(x) - Q_2(x) = -1$

Substituting this in gives: $-(x^2+1) + xQ_1(x) - x + 1 = 0$

Solving this equation, we get $Q_1(x) = x + 1$

Plugging this into our original equation we get $P(x) = x^3 + 2x^2 + 3x + 3$

Verify this works with $P(x) = (x^2+1)Q_2(x) + 2x + 1$

Therefore the answer is $1^2 + 2^2 + 3^2 + 3^2 = \boxed{\textbf{(E)} \ 23}$

~qgcui

## Solution 4 (Undetermined Coefficients)

Notice that we cannot have the quotients equal to some constants, since the same constant will yield different constant terms for $P(x)$ (which is bad) and different constants will yield different first coefficients (also bad). Thus, we try setting the quotients equal to linear terms (for minimizing degree).

Let $P(x)=(x^2+x+1)(ax+b)+(x+2)$ and $P(x)=(x^2+1)(ax+c)+(2x+1)$. The quotients have the same $x$ coefficient, since $P(x)$ must have the same $x^3$ coefficient in both cases. Expanding, we get $$P(x)=ax^3+(a+b)x^2+(a+b+1)x+(b+2)$$ and $$P(x)=ax^3+cx^2+(a+2)x+(c+1).$$

Equating coefficients, we get $b+2=c+1$, $a+b+1=a+2$, and $a+b=c$. From the second equation, we get $b=1$, then substituting into the first, $c=2$. Finally, from $a+b=c$, we have $a=1$. Now, $P(x)=(x^2+x+1)(ax+b)+(x+2)=(x^2+x+1)(x+1)+(x+2)=x^3+2x^2+3x+3$ and our answer is $$1^2+2^2+3^2+3^2=\boxed{\textbf{(E)} \ 23}.$$

~MathHayden

## Solution 5 (Quick, but Not Quicker Than 2)

We construct the following equations in terms of $P(x)$ and the information given by the problem: $$\textbf{(1) } P(x)=(x^2+x+1)\cdot Q(x)+x+2$$ $$\textbf{(2) } P(x)=(x^2+1)\cdot R(x)+2x+1$$ Upon inspection, $Q(x)$ and $R(x)$ cannot be constant, so the smallest possible degree of $P(x)$ is $3,$ and both $Q(x)$ and $R(x)$ are linear.

Let $Q(x)=x-q$ and $R(x)=x-r.$ We know there will be values for $q$ and $r$ that make the below equation hold, so we can assume that $P(x)$ has a leading coefficient of $1$.

Substituting these values in, and setting $\textbf{(1)}$ and $\textbf{(2)}$ equal to each other, $$(x^2+x+1)(x-q)+x+2=(x^2+1)(x-r)+2x+1.$$ We plug in $x=0$, yielding $r+1=q.$ Substituting this value into the above equation, $$(x^2+x+1)(x-r-1)+x+2=(x^2+1)(x-r)+2x+1.$$ Letting $x=1,$ we conclude that $r=-2,$ so $R(x)=x+2.$ Therefore, $$P(x)=(x^2+1)(x+2)+2x+1 = x^3+2x^3+3x+3.$$ The requested sum is $$1^2+2^2+3^2+3^2=\boxed{\textbf{(E) }23}$$

-Benedict T (countmath1)

## Solution 6 (Similar to Solution 3)

By remainder theorem, the polynomial can be written as follows.

$$P(x) = (x^2+x+1)Q_{1}(x)+x+2 = (x^2+1)Q_{2}(x)+2x+1$$ This is a timed exam, we can use the information given by answer choices. The answer choices tell us this is the polynomial with integer coefficients, and we need to find the polynomial with the least degree so we can assume both $Q_{1}(x)$ and $Q_{2}(x)$ are linear (the coefficient of x should be same).

Then we can write $P(x)$ as a cubic polynomial.

$$P(x) = (x^2+x+1)(ax+b)+x+2 = (x^2+1)(ax+c)+2x+1$$ Substituting $x=0,1,-1$ to determine the value of $a$ and $b$.

We have: $$P(0) = b+2 = c+1$$ $$P(1) = 3a+3b+3 = 2a+2c+3$$ $$P(-1) = -a+b+1 = -2a+2c-1$$

We can solve the simultaneous equations: $a=1,b=1,c=2$

Hence, $P(x)=(x^2+x+1)(x+1)+x+2=x^3+2x^2+3x+3$. The answer is $1^2+2^2+3^2+3^2=\boxed{\textbf{(E) }23}$

~PythZhou

~ ThePuzzlr

## Video Solution

~Steven Chen (Professor Chen Education Palace, www.professorchenedu.com)

~ pi_is_3.14

~Interstigation
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 106, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://artofproblemsolving.com/wiki/index.php/2022_AMC_12B_Problems/Problem_20", "fetch_time": 1702110366000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-50/segments/1700679100873.6/warc/CC-MAIN-20231209071722-20231209101722-00623.warc.gz", "warc_record_offset": 136114853, "warc_record_length": 17578, "token_count": 2263, "char_count": 5777, "score": 4.78125, "int_score": 5, "crawl": "CC-MAIN-2023-50", "snapshot_type": "latest", "language": "en", "language_score": 0.7525792717933655, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00059-of-00064.parquet"}