Call a number $n$ good if it can be expressed as $2^x+y^2$ for where $x$ and $y$ are nonnegative integers. (a) Prove that there exist infinitely many sets of $4$ consecutive good numbers. (b) Find all sets of $5$ consecutive good numbers. Proposed by Michael Ma
Problem
Source: ELMO SL 2018 N2
Tags: number theory
28.06.2018 23:56
28.06.2018 23:59
On the other hand, part (b) is quite fun... The answers are the six tuples $\{1,2,3,4,5\}$, $\{2,3,4,5,6\}$, $\{8,9,10,11,12\}$, $\{9,10,11,12,13\}$, $\{288, 289, 290, 291, 292\}$, $\{289, 290, 291, 292, 293\}$. These all work since \begin{align*} 1 &= 2^0+0^2, \quad 2 = 2^0+1^2, \quad 3 = 2^1+1^2, \\ 4 &= 2^2+0^2, \quad 5 = 2^2+1^2, \quad 6 = 2^1+2^2 \\ 8 &= 2^3+0^2, \quad 9 = 2^3+1^2, \quad 10 = 2^0+3^2, \\ 11 &= 2^1+3^2, \quad 12 = 2^3+2^2, \quad 13 = 2^2+3^2, \\ 288 &=2^5+16^2, \quad 289 = 2^6+15^2, \quad 290 = 2^0+17^2, \\ 291 &= 2^1+17^2, \quad 292 = 2^8+6^2, \quad 293 = 2^2+17^2. \end{align*} We now show they are the only ones. First, consider the following table which shows $2^x+y^2 \pmod 8$: \[ \begin{array}{c|cccc} & x=0 & x=1 & x=2 & x\ge3 \\ \hline y \equiv 1 \pmod 2 & 2 & 3 & 5 & 1 \\ y \equiv 0 \pmod 4 & 1 & 2 & 4 & 0 \\ y \equiv 2 \pmod 4 & 5 & 6 & 0 & 4 \end{array} \]Note that from this table, no good number is $7 \pmod 8$. Thus any five good numbers must have a $3 \pmod 8$ number. By table can only occur if that good number is of the form $t^2 + 2^1 = t^2+2$ for an odd integer $t$. We now have several cases. Case 1: Suppose the five good numbers are $\{t^2+1, t^2+2, t^2+3, t^2+4, t^2+5\}$. Note that $t^2+5 \equiv 6 \pmod 8$, and by table, this can only occur if $t^2 + 5 = s^2 + 2^2 = s^2 + 4$ for some integer $s$; hence $t^2 - s^2 = 1$, so $t = 1$ and $s = 0$. This gives the solution set $\{2,3,4,5,6\}$. Case 2: Suppose the five good numbers are $\{t^2, t^2+1, t^2+2, t^2+3, t^2+4\}$. Since $t^2$ is good, we have $t^2 = 2^w + z^2$ for some $w$ and $z$, which we write as $(t-z)(t+z) = 2^w$. We now split into cases. Subcase 2.1: We handle the situation where $w < 4$. If $w = 0$, then we get $t = 1$, which gives the solution $\{1,2,3,4,5\}$. If $w = 1$, then there are no solutions by taking mod $4$. If $w = 2$, then $t^2 = 4+z^2$ which implies $t = 2$, but $t$ was odd. If $w = 3$, we get $t^2 = 8 + z^2$ which implies $t = 3$, which gives $\{9, 10, 11, 12, 13\}$. If $w = 4$, we get $t^2 = 16 + z^2$ which together with $t$ odd implies $t = 5$, which gives $\{25, 26, 27, 28, 29\}$. However, the number $28$ is not good, so this is not a solution. Subcase 2.2: Suppose $w \ge 5$. As $\gcd(t-z,t+z) \mid 2t$ we must have $t-z=2$, $t+z=2^{w-1}$, and thus $t = \tfrac12\left( 2 + 2^{w-1} \right) = 2^{w-2}+1$. Since $t$ was odd, we actually have $w \ge 3$. But $t^2+3$ is also good, so write \[ t^2 + 3 = 2^x + y^2. \]So we split into cases again. Subcase 2.2.1: We handle the case $x < 3$. If $x=0$, we get $t^2 + 2 = y^2$ which has no solutions. If $x=1$, we get $t^2 + 1 = y^2$ which implies $t=0$, but $t$ is supposed to be odd. If $x=2$, then we get $t^2 = y^2+1$ which implies $t = 1$, which was an earlier solution. Subcase 2.2.2: Otherwise, assume $x \ge 3$. \begin{align*} 2^x+y^2 &= t^2 + 3 \\ \implies 2^x+y^2 &= \left( 2^{w-2}+1 \right)^2 + 3 \\ &= 2^{2w-4} + 2^{w-1} + 4 \\ \implies 2^{2w-6} + 2^{w-3} + 1 &= 2^{x-2} + (y/2)^2 \end{align*}since $y$ is clearly even; the last line implies $y/2$ is odd, since $2w-6 > 0$, $w-3 > 0$, $x-2 > 0$. Let $c=w-3 \ge 2$, $a = x-2 \ge 1$, $b=y/2 \ge 1$ for brevity; then the equation rewrites as \[ 2^{2c} + 2^c + 1 = 2^a + b^2 .\]We rewrite this as \[ (2^c+1-b)(2^c+1+b) = (2^c+1)^2-b^2 = 2^a+2^c \ge 0. \]In light of this, we have $2^a+2^c \ge (2^c+1)^2 - 2^{2c} > 2^{c+1}$, so $2^a > 2^c$, ergo $a > c$. Thus we may further write \[ (2^c+1-b)(2^c+1+b) = 2^{c} (2^{a-c}+1). \]The factors on the left-hand side are nonnegative and have gcd dividing $2b$, hence one of them has at most one factor of $2$. So one of the factors must be divisible by $2^{c-1}$. Thus, $b \equiv \pm 1 \pmod{2^{c-1}}$. But, $b < 2^c+1$. So we have four possibilities: Subcase 2.2.2.1: suppose $b = 1$. Then we get $2^{2c} + 2^c = 2^a$, which is impossible. Subcase 2.2.2.2: suppose $b = 2^{c-1}-1$. Then we get $(2^{c-1}+2)(2^c + 2^{c-1}) = 2^c ( 2^{a-c} + 1 )$ and hence $3 \cdot 2^{c-2} = 2^{a-c}-2$. This implies $a-c=3$ and $c-2=1$, so $c = 3$, or $w = 6$, hence $t = 2^{w-2}+1 = 17$. This gives $\{289,290,291,292,293\}$ which indeed works. Subcase 2.2.2.3: suppose $b = 2^{c-1}+1$. Then we get $2^{c-1}(2^c + 2^{c-1} + 2) = 2^c ( 2^{a-c} + 1 )$, or $2^{c-1} + 2^{c-2} + 1 = 2^{a-c} + 1$, which is impossible. Subcase 2.2.2.4: suppose $b = 2^c-1$. This gives $2 \cdot 2^{c+1} = 2^c ( 2^{a-c} + 1)$, which is impossible. Case 3: Suppose the five good numbers are $\{t^2-1, t^2, t^2+1, t^2+2, t^2+3\}$. In that case, $\{t^2, t^2+1, t^2+2, t^2+3, t^2+4\}$ is also a set of five consecutive good numbers. Using case 2, the new candidate this now gives are $\{8,9,10,11,12\}$ and $\{288, 289, 290, 291, 292\}$, which work.
29.06.2018 06:09
Kaskade wrote:
Motivation, please?
29.06.2018 07:11
18.01.2020 00:15
(a) We claim that $(a^2-1,a^2,a^2+1,a^2+2)$ works for $a=2^n+1$ where $n\ge 1$. Indeed, \begin{align*} a^2-1 &= 2^{n+1}+(2^n)^2 \\ a^2 &= 2^{n+2}+(2^n-1)^2 \\ a^2+1 &= 2^0+a^2 \\ a^2+2 &= 2^1+a^2. \end{align*}(b) We claim that the solutions are $(1,2,3,4,5)$, $(2,3,4,5,6)$, $(8,9,10,11,12)$, $(9,10,11,12,13)$, $(288,289,290,291,292)$, and $(289,290,291,292,293)$. It is straightforward but tedious to confirm that these work, so we ommit the proof here. The key for this proof is to essentially reduce to the construction we had for (a). It will turn out that the main calculation will be the following claim, and for sake of readability, we state and prove this claim now. Claim: The quantity $f(n):=(2^n+1)^2+3$ is good if and only if $n=1$ or $n=4$. Proof: It is easy to check that the only $n\in\{0,1,2,3\}$ such that $f(n)$ is good is $n=1$. Furthermore, it is easy to check that $n=4$ works, as \[f(4)=292=2^8+6^2.\]From now on, we'll assume that $n\ge 4$. Suppose that $f(n)$ was good, or that \[(2^n+1)^2+3=2^x+y^2,\]or \begin{align*} \boxed{y^2=2^{2n}+2^{n+1}+4-2^x}. \quad\quad(1)\end{align*}We'll now split into cases. Case 1: Suppose $x\le n+1$. We have a few subcases. Case 1.1: Suppose $x=0$. Then \[y^2=2^{2n}+2^{n+1}+3=(2^n+1)^2+2.\]No two squares differ by $2$, so there are no solutions here. Case 1.2: Suppose $x=1$. Then \[y^2=2^{2n}+2^{n+1}+2=(2^n+1)^2+1.\]Note that $2^n+1\ge 17$, and no two squares besides $0,1$ differ by $1$, so there are no solutions here. Case 1.3: Suppose $2\le x\le n+1$. We then have \[y^2\le 2^{2n}+2^{n+1}<(2^n+1)^2\]and \[y^2\ge 2^{2n}+4>2^{2n},\]so \[(2^n)^2<y^2<(2^n+1)^2.\]This means there are no solutions here. Case 2: Suppose $x\ge n+2$. Let $\boxed{x=n+1+\alpha}$ where $\alpha\ge 1$. We see from (1) that $y$ is even, so let $\boxed{y=2z}$. Furthermore, let $\boxed{m=n-1}$. We see that (1) reduces to \[z^2=2^{2m}-2^m(2^\alpha-1)+1.\]This means that $z$ is odd and less than $2^m$, so let $\boxed{z=2^m-k}$ where $k\ge 1$ is odd. Then, \[z^2=2^{2m}-2^m(2k)+k^2,\]so \begin{align*}\boxed{2^m(2k-2^\alpha+1)=(k-1)(k+1)}.\quad\quad (2)\end{align*}We have some subcases. Case 2.1: Suppose $k\equiv 1\pmod{4}$. From (2), we have $2^m\mid(k-1)(k+1)$, so \[2^{m-1}\mid(k-1)(\tfrac{k+1}{2}).\]Since $(k+1)/2$ is odd, we have $2^{m-1}\mid k-1$, so write $\boxed{k=1+2^{m-1}\beta}$, where $\beta\ge 0$. Plugging this into (2) gives \[2^m(2+2^m\beta-2^\alpha+1)=2^{m-1}\beta\cdot 2(2^{m-2}\beta+1),\]or \begin{align*}\boxed{2^m\beta-2^\alpha+3=2^{m-2}\beta^2+\beta}.\quad\quad(3)\end{align*}The left side of the above equation is odd, so the right side is odd. Since $m=n-1\ge 3$, we therefore have that $\beta$ is odd. Case 2.1.1: Suppose $\beta=1$. Then, \[2^m-2^\alpha+3=2^{m-2}+1,\]so \[3(2^{m-2}+1)=2^\alpha+1.\]It is easy to see that the above equation has the unique solution $m=3$ and $\alpha=3$. This gives $n=4$, which is a solution. Case 2.1.2: Suppose $\beta=3$. Then, \[3\cdot 2^m-2^\alpha+3=2^{m-2}\cdot 9+3,\]so $3\cdot 2^{m-2}=2^\alpha$. This has no solutions. Case 2.1.3: Suppose $\beta\ge 5$. By (3), \[3-2^\alpha=2^{m-2}(\beta^2-4\beta)+\beta\ge 5\cdot 2^{m-2}\ge 10,\]which has no solutions. Case 2.2: Suppose $k\equiv 3\pmod{4}$. From (2), we have $2^m\mid(k-1)(k+1)$, so \[2^{m-1}\mid(k+1)(\tfrac{k-1}{2}).\]Since $(k-1)/2$ is odd, we have $2^{m-1}\mid k+1$, so write $\boxed{k=-1+2^{m-1}\beta}$, where $\beta\ge 1$. Plugging this into (2) gives \[2^m(2^m\beta-2-2^\alpha+1)=2^{m-1}\beta\cdot 2(2^{m-2}\beta-1),\]or \begin{align*}\boxed{2^m\beta-2^\alpha-1=2^{m-2}\beta^2-\beta}.\quad\quad(4)\end{align*}The left side of the above equation is odd, so the right side is odd. Since $m=n-1\ge 3$, we therefore have that $\beta$ is odd. Case 2.2.1: Suppose $\beta=1$. Then, \[2^m-2^\alpha-1=2^{m-2}+1,\]so $3\cdot 2^{m-2}=2^\alpha$, which has no solutions. Case 2.2.2: Suppose $\beta=3$. Then, \[3\cdot 2^m-2^\alpha-1=2^{m-2}\cdot 9-3,\]so \[2^{m-2}\cdot 3=2^\alpha-2.\]For the right side to be divisible by $3$, we need $3\mid \alpha$. Case 2.2.2.1 Suppose $\alpha=3$. Then, we get $m=3$, so $n=4$, which is a solution. Case 2.2.2.2 Suppose $\alpha\ge 6$. Then, right side is $2\pmod{4}$, so we must have $m=3$. But this is a contradiction to size, so no solutions here. Case 2.2.3: Suppose $\beta\ge 5$. By (4), \[-1-2^\alpha=2^{m-2}(\beta^2-4\beta)-\beta\ge 2(\beta^2-4\beta)-\beta\ge 5,\]which has no solutions. This completes all the cases, so the only solution for $n\ge 4$ is $n=4$. This completes the proof of the claim. $\blacksquare$ Let's return to solving the original problem. We'll be needing two recurring lemmas. Lemma: Suppose $n$ is good. Then, $n\equiv 2\pmod{4}$ implies either $n=a^2+1$ for odd $a$, or $n=a^2+2$ for even $a$. Similarly, if $n\equiv 3\pmod{4}$, then $n=a^2+2$ for odd $a$. Proof: The key is that if $x\ge 2$, then $2^x+y\equiv 0,1\pmod{4}$. So if $n=2^x+y\equiv 2,3\pmod{4}$, then $x=0$ or $x=1$. Working out the details of mod $4$ gives the result. $\blacksquare$ Lemma: Suppose $a^2$ is good where $a$ is odd. Then either $a=1$, or $a=2^n+1$ for some $n\ge 1$. Proof: Suppose $a^2=2^x+y^2$ where $x\ge 1$. Then, we have $a^2=2^x+y^2$, so \[(a-y)(a+y)=2^x.\]Now, $a-y\equiv a+y\pmod{2}$, and since $x\ge 1$, this means that they both must be even. Thus, $a-y=2^p$ and $a+y=2^q$ for some $p,q\ge 1$, so $a=\tfrac{2^p+2^q}{2}$. Since $a$ is odd, this means $a=2^n+1$ for some $n\ge 1$. Now, if $x=1$, then $a^2=1+y^2$. This means $y=0$ and $a=1$, as desired. This completes the proof of the lemma. $\blacksquare$ Suppose that $(a_1,a_2,a_3,a_4,a_5)$ are $5$ consecutive positive integers that are all good. We have $4$ cases. Case 1: Suppose $a_1\equiv 0\pmod{4}$. We see that $a_4\equiv 3\pmod{4}$ is good, so $a_4=a^2+2$ for some odd $a$. Thus, the numbers \[(a^2-1,a^2,a^2+1,a^2+2,a^2+3)\]are all good. Thus, $a^2$ is good and $a$ odd, so $a=1$ or $a=2^n+1$ for $n\ge 1$. We can't have $a=1$ as $1^2-1=0$ is not good, so we must have $a=2^n+1$. Thus, $a^2+3=(2^n+1)^2+3$ is good, so by the claim, we have either $n=1$ or $n=4$. These give the two solutions \[\boxed{(8,9,10,11,12) \quad \text{and} \quad (288,289,290,291,292)}.\] Case 2: Suppose $a_1\equiv 1\pmod{4}$. We see that $a_3\equiv 3\pmod{4}$ is good, so $a_3=a^2+2$ for some odd $a$. Thus, the numbers \[(a^2,a^2+1,a^2+2,a^2+3,a^2+4)\]are all good. Thus, $a^2$ is good and $a$ odd, so $a=1$ or $a=2^n+1$ for $n\ge 1$. If $a=1$, then we get the solution \[\boxed{(1,2,3,4,5)}.\]Now suppose $a=2^n+1$ for $n\ge 1$. Thus, $a^2+3=(2^n+1)^2+3$ is good, so by the claim, we have either $n=1$ or $n=4$. These give the two solutions \[\boxed{(9,10,11,12,13) \quad \text{and} \quad (289,290,291,292,293)}.\] Case 3: Suppose $a_1\equiv 2\pmod{4}$. Then, $a_2\equiv 3\pmod{4}$ is good, so $a_2=a^2+2$ for some odd $a$. Thus, the numbers \[(a^2+1,a^2+2,a^2+3,a^2+4,a^2+5)\]are all good. Now, $a^2+5\equiv 2\pmod{4}$ is good, so by the first lemma, we have the following two subcases. Case 3.1: Suppose $a^2+5=b^2+1$ for odd $b$. Then, $b^2-a^2=4$, so $a=0$, which isn't odd. Case 3.2: Suppose $a^2+5=b^2+2$ for even $b$. Then, $b^2-a^2=3$, so $a=1$. This gives the solution \[\boxed{(2,3,4,5,6)}.\] Case 4: Suppose $a_1\equiv 3\pmod{4}$. Then, $a_1\equiv 3\pmod{4}$ is good, so $a_1=a^2+2$ for some odd $a$. Thus, the numbers \[(a^2+2,a^2+3,a^2+4,a^2+5,a^2+6)\]are all good. We see that $a^2+6\equiv 3\pmod{4}$ is good, so $a^2+6=b^2+2$ for odd $b$. Thus, $b^2-a^2=4$, so $a=0$, which isn't odd. So there are no solutions here. We've shown that all the solutions must be in the claimed list, so we're done.
30.03.2022 18:26
$(\text a)$ Consider: $$\{2^{2m}-2^{m+1}+2,2^{2m}-2^{m+1}+3,2^{2m}-2^{m+1}+4,2^{2m}-2^{m+1}+5\}=\left\{2^0+(2^m-1)^2,2^1+(2^m-1)^2,2^{m-1}+(2^m-2)^2,2^2+(2^m-1)^2\right\}.$$ $(\text b)$ Claim: the statements in the following list hold: If $m\equiv0\pmod8$ then either $x=2$ and $y=4k+2$ or $x\ge3$ and $y=4k$. If $m\equiv1\pmod8$ then either $x=0$ and $y=4k$ or $x\ge3$ and $y=2k+1$. If $m\equiv2\pmod8$ then either $x=0$ and $y=2k+1$ or $x=1$ and $y=4k$. If $m\equiv3\pmod8$ then $x=1$ and $y=2k+1$. If $m\equiv4\pmod8$ then either $x=2$ and $y=4k$ or $x\ge3$ and $y=4k+2$. If $m\equiv5\pmod8$ then either $x=0$ and $y=4k+2$ or $x=2$ and $y=2k+1$. If $m\equiv6\pmod8$ then $x=1$ and $y=4k+2$. $m\not\equiv7\pmod8$. Let $m=2^x+y^2$. Since $2^x\in\{0,1,2,4\}\pmod8$ and $y^2\in\{0,1,4\}\pmod8$ testing all possibilities easily gives the above list Suppose $\{n,n+1,n+2,n+3,n+4\}$ is such a set, with $n+\ell=2^{x_\ell}+y_\ell^2$ for $0\le\ell\le4$. By the claim there are three cases to consider for $n\pmod8$. Case 1: $n\equiv2\pmod8$ We have $n+1\equiv3\pmod8$ which implies $x_1=1$ and $y_1=2a+1$ for some $a$ by the claim. Then $n+1=2+(2a+1)^2$ which may be rewritten as $n=4a^2+4a+2$ Also, $n+4\equiv6\pmod8$ which implies $x_4=1$ and $y_4\equiv2\pmod4$ by the claim. Let $y_4=4b+2$, then $n+4=2+(4b+2)^2$ which rewrites as $n=16b^2+16b+2$. Equating the two gives $a^2+a=4b^2+4b$, but since: $$(2b)^2+2b<4b^2+4b<(2b+1)^2+2b+1$$this is impossible. Case 2: $n\equiv1\pmod8$ Let $n=2^x+y^2$ and $n+3=2^s+t^2$. As before, $n+2\equiv3\pmod8$ which implies $x_2=1$ and $y_2=2a+1$, so $n=(2a+1)^2$. Suppose $x=0$. Then $(2a+1)^2=y^2+1$, so $(2a+1-y)(2a+1+y)=1$. Testing all cases gives that we must have $n=1$ which is a solution. Suppose $x=1$. Then $(2a+1)^2=y^2+2$, so $(2a+1-y)(2a+1+y)=2$. Testing all cases gives that no solutions exist. For the same reason, we cannot have $s=2$. Suppose $x=2$. Then $(2a+1)^2=y^2+4$, so $(2a+1-y)(2a+1+y)=4$. Testing all cases gives that no solutions exist. Suppose $x=3$. Then $(2a+1)^2=y^2+8$, so $(2a+1-y)(2a+1+y)=8$. Testing all cases gives that we must have $n=9$ which is a solution. Suppose $x=4$. Then $(2a+1)^2=y^2+16$, so $(2a+1-y)(2a+1+y)=16$. Testing all cases gives that no solutions exist. Now we can assume that $x\ge5$ and $s\ne2$. We have $(2a+1)^2=2^x+y^2$, so $(2a+1-y)(2a+1+y)=2^x$. Then let $2a+1-y=2^p$ and $2a+1+y=2^q$ with $p+q=x$. We have: $$2a+1=2^{p-1}+2^{q-1}$$so for parity reasons either $p=q=0$ or $(p=1$ or $q=1)$. But since $p\le q$ we have $p=0$ or $p=1$. The former is clearly impossible, so $2a+1-y=2$ and $2a+1+y=2^{x-1}$. We have $y=2a-1$ so $a=2^{x-3}$ and $y=2^{x-2}-1$. Note that $n=2^x+(2^{x-2}-1)^2=(2^{x-1}+1)^2$ at this point. Now we deal with the equation $n+3=2^s+t^2$. By Claim 1, $t=4u+2$ (since we already saw what happens when $s=2$). Now the equation implies: $$(2^{x-2}-2u)(2^{x-2}+2u+2)=2^{s-2}+2^{x-2}.$$Let $i=x-2$, $j=s-2$, and $k=u$ in order to preserve sanity, and write: $$(2^j-2k)(2^j+2k+2)=2^j+2^i.$$From this equation: $$2^i=2^j+2^{2j}-4k^2-4k>2^j+2^{2j}-(2k+1)^2=2^j+(2^j-2k-1)(2^j+2k+1)>2^j,$$where we used the fact that if $2^j>2k$ then $2^j>2k+1$. Then $i>j$, so: $$(2^j-2k)(2^j+2k+2)=2^{j-1}(2+2^{i-j+1}).$$Similarly to before, either $2^{j-1}\mid 2^j-2k$ or $2^{j-1}\mid 2^j+2k+2$. If the former is true, $k=0$ or $k=2^{j-2}$. If $k=0$, it implies $t=2$, so $n$ is one more than a power of $2$. But $n=(2^{x-1}+1)^2$ implies that $2^x(2^{x-2}+1)$ is a power of two, which is impossible as $x\ge5$. If $k=2^{j-2}$, then $t=2^j+2$ so the equation rearranges as $3\cdot2^{j-3}+1=2^{i-j-1}$, so $i=6$ and $j=3$. Then $x=5$, so $n=289$ which is a solution. If the latter is true, $k=2^{j-1}-1$ or $k=2^j-1$ (since $2^j>2k$). If $k=2^{j-1}-1$, we have $2^{j+1}=1+2^{i-j}$, so no solutions. If $k=2^j-1$, there are also no solutions. Case 3: $n\equiv0\pmod8$ Using an isomorphic approach from Case 2, we have either $n=2$ or $n=8$ or $n=288$. So the only solutions are $\{1,2,3,4,5\}$, $\{2,3,4,5,6\}$, $\{8,9,10,11,12\}$, $\{9,10,11,12,13\}$, $\{288,289,290,291,292\}$, $\{289,290,291,292,293\}$.
28.05.2023 00:52
This problem was fun until the case bash became nontrivial. After that point, it was just painful to fix everything. Anyway, here's a solution: For a), the numbers $x^2+1, x^2+2, x^2+3, x^2+4$ are good for $x = 2^{n}-1$. Clearly $x^2+2^{0}$, $x^2+2^{1}$ and $x^2+2^{2}$ are good and also \[x^2+3 = (2^{n}-1)^2+3 = (2^{n}-2)^2+2^{n+1}\]so these consecutive numbers work. As the sets are disjoint for different $n$ we've shown that there exist infinitely many sets of $4$ consecutive good numbers. For b), we begin by describing some numbers which aren't good: If $7\mid n$, then $n$ isn't good. Indeed, for all nonnegative integers $x, y$ we have that $2^{x} \equiv 1,2,4\pmod 7$ and $y^2 \equiv 0,1,2,4\pmod 7$, so $7\nmid 2^{x}+y^2$ for all $x,y$. If $n\equiv 7 \pmod 8$, then $n$ isn't good. Indeed, for all nonnegative integers $x, y$ we have that $2^{x} \equiv 0,1,2,4\pmod 8$ and $y^2 \equiv 0,1,4\pmod 8$, so $2^{x} + y^2 \not\equiv 7\pmod 8$. If $n\equiv 2\pmod 4$ and there doesn't exist a nonnegative integer $m$ such that $n = m^2+1$ or $n = 2(2m^2+1)$, then $n$ isn't good. Indeed, assume that $2^{x} + y^2 = n$. If $x=0$ this forces $n = y^2+1$, impossible. If $x\geq 1$, then $2\mid n - 2^{x} = y^2$, so $4\mid y^2$ and therefore $x = 1$ as $n\equiv 2\pmod 4$. Then we must have $n = 4y_{0}^2+2 = 2(2y_{0}^2+1)$, also impossible. By combining the first two bullets, we can notice that if $x, x+1, x+2, x+3, x+4$ are all good positive integers, then \[x\equiv 1, 2, 8, 9, 16, 50 \pmod{56}\]are the only possible residues for $x$ modulo $56$. By examining small values for $x$, we see that the sets \[\{1 = 2^{0} + 0^2, 2 = 2^{1} + 0^2, 3 = 2^{1} + 1^2, 4 = 2^{2} + 0^2, 5 = 2^{2} + 1^2\}\]\[\{2 = 2^{1} + 0^2, 3 = 2^{1} + 1^2, 4 = 2^{2} + 0^2, 5 = 2^{2} + 1^2, 6 = 2^{1} + 2^{2}\}\]\[\{8 = 2^{3} + 0^2, 9 = 2^{3} + 1^2, 10 = 2^{0} + 3^2, 11 = 2^{1} + 3^{2}, 12 = 2^{3} + 2^{2}\}\]\[\{9 = 2^{3} + 1^2, 10 = 2^{0} + 3^2, 11 = 2^{1} + 3^{2}, 12 = 2^{3} + 2^{2}, 13 = 2^{2} + 3^2\}\]work. Hence from hereon, we'll assume that $x\geq 10$. Now the third bullet can be expanded on. We'll show that $4k+2$ and $4k+6$ can't both be good. Assume the contrary. There are a couple of cases to consider: $4k+2 = a^2+1$, $4k+6 = b^2+1$. Then $b^2 - a^2 = 4$, so we get: \[4 = b^2 - a^2 \geq (a+1)^2-a^2 = 2a+1\Longrightarrow a\leq 1 \Longrightarrow k\leq 0\]In this case $x<10$, impossible. $4k+2 = 4a^2+2$, $4k+6 = 4b^2+2$. Then $b^2 - a^2 = 1$ which forces $b = 1$, $a=0$ and again $x<10$. $4k+2 = a^2+1$, $4k+6 = 4b^2+2$. Then $k = b^2-1$, so \[a^2+1 = 4k+2 = 4(b^2-1)+2\Longrightarrow (2b)^2 - a^2 = 3\Longrightarrow a\leq 1, x<10\] $4k+2 = 4a^2+2$, $4k+6 = b^2+1$. Then $k = a^2$, so \[b^2+1 = 4k+6 = (2a)^2+6\Longrightarrow b^2 - (2a)^2 = 5 \Longrightarrow 2a\leq 2, x<10\] Having proven that $4k+2$ and $4k+6$ can't both be good for $k>1$, we can't have $x \equiv 50 \pmod{56}$ because then $x\equiv x+4 \equiv 2\pmod 4$. Also, $x\equiv 2\pmod{56}$ is impossible for the same reason. Assume that $x \equiv 16 \pmod{56}$ works and let $x = 56k+16$. Then $x+2 = 56k + 18 \equiv 2\pmod{4}$, so either $x+2 = a^2+1$. But then $56k+17 = x+1 = a^2$ and so $a^2 \equiv 3\pmod 7$ and $3$ isn't a QR modulo $7$, contradiction. or $x+2 = 4a^2+2$. But then $56k+16 = x = 4a^2$ and so $a^2 = 14k+4 \equiv 4\pmod 7$ and $4$ isn't a QR modulo $7$, contradiction. We're left to check the cases $x\equiv 1,8,9\pmod{56}$. If $x\equiv 8$ or $9\pmod{56}$, then $56k+10$ must be good for some $k$. Consider the following cases: $56k+10 = 4a^2+2$. Let $56k+9 = 2^{x_{1}}+y_{1}^2$ and $56k+11 = 2^{x_{2}}+y_{2}^2$. Due to parity both $y_{1}$ and $y_{2}$ must be odd, so \[2\equiv (56k+11) - (56k+9) = (2^{x_{1}}+y_{1}^2) - (2^{x_{2}}+y_{2}^2) \equiv 2^{x_{1}} - 2^{x_{2}} \pmod 4\]Therefore $\min(x_{1}, x_{2}) = 1$. But $56k+8$ is $2$ above a square and now also $56k+9$ or $56k+11$ must be $2$ above a perfect square, impossible due to a trivial size argument. $56k+10 = a^2+1$. In order for $56k+9$ to be good, we must have \[a^2 = 56k+9 = 2^{b}+c^2\Longrightarrow (a+c)(a-c) = 2^{b}\]Therefore if $a+c = 2^{d+1}$, $a-c = 2^{e+1}$, then $a = 2^{d} + 2^{e}$ which is odd, so $e = 0$ and $a = 2^{d}+1$. Assume that $56k+12$ is good. Then there exist positive integers $N, M$ such that: \[(2^{d}+1)^2+3 = N^2+2^{M}\]For parity reasons, $N$ must be even, so $N = 2n$. Dividing both sides by $4$, we get \[2^{2d-2}+2^{d-1}-2^{M-2} = (n-1)(n+1)\]However, $N^2 < (2^{d}+1)^2$, so \[2^{M} = 2^{2d}+2^{d+1}+4 - N^2 \geq 2^{2d} + 2^{d+1} + 4 - 2^{2d} = 2^{d+1} + 4 > 2^{d+1} \Longrightarrow M > d + 1\]Hence we have that $\nu_{2}(n^2-1) = \nu_{2}(2^{2d-2}+2^{d-1}-2^{M-2}) = d-1$ which implies that $2^{d-1} \mid (n-1)(n+1)$, so $n\in\{2^{d-2}-1, 2^{d-2}+1, 2^{d-1}-1\}$ or $n > 2^{d-1}$. In the latter case $N = 2n > 2^{d}$, so $N^2 + 2^{M} \geq (2^{d}+2)^2 + 1> (2^{d}+1)^2+3$, impossible. The remaining cases can be dealt with directly: $n = 2^{d-2}-1$. Then $N = 2^{d-1}-2$ and so: \[2^{M} = (2^{d}+1)^2+3-(2^{d-1}-2)^2 = 2^{d-2}(3\cdot 2^{d} + 16)\]The right-hand expression is a power of $2$ only for $d = 4$ when $M = 8$ which leads to $a = 2^{d}+1 = 17$ and $56k+9 = a^2 = 289$. Indeed, the numbers $288, 289, 290, 291, 292, 293$ are good: \[288 = 2^5+16^{2}, 289 = 2^{6} + 15^2, 290 = 2^{0} + 17^2, 291 = 2^{1}+17^2, 292 = 2^{8} + 6^2, 293 = 2^{2}+17^{2}\] $n = 2^{d-2}+1$. Then $N = 2^{d-1}+2$ and so: \[2^{M} = (2^{d}+1)^2+3-(2^{d-1}+2)^2 = 3\cdot 4^{d-1}\]which clearly leads to no solutions. $n = 2^{d-1}-1$. Then $N = 2^{d}-2$ and so: \[2^{M} = (2^{d}+1)^2+3-(2^{d}-2)^2 = 3\cdot 2^{d+1}\]which clearly leads to no solutions. Therefore, the sets $\{288,289,290,291,292\}$ and $\{289,290,291,292,293\}$ also work. Finally, if $x\equiv 1\pmod{56}$ and $x>10$, we must have $x = 56k+1$ for some $k\geq 1$. Then $56k+2 = a^2+1$ or $56k+2 = 4a^2+2$ for some positive integer $a$. In the first case $x = 56k+1 = a^2$ and $x$ is good, so $a = 2^{d}+1$ as in the case $56k+10 = a^2+1$ above. Now we get that \[56k+1 = a^2 = (2^{d}+1)^2 = 2^{d+1}(2^{d-1}+1)+1\Longrightarrow 7\mid 2^{d-1}+1\]The last is impossible as $2^{d-1}\not\equiv 6\pmod 7$. In the second case $56k+2 = 4a^2+2$. However, we mentioned above that two consecutive odd integers can be simultaneously good if one of them is $2$ above a perfect square. However, in this case, $56k = 4a^2$ is a perfect square, so we get a size contradiction as $56k+1, 56k+3, 56k+5$ are good. In conclusion, all sets of $5$ consecutive good numbers $\{x,x+1,x+2,x+3,x+4\}$ are $x = 1, 2, 8, 9, 288, 289$.
18.10.2024 19:25
Could only solve part (a): \(solution\): Take $y=2^k-1$. Note that $y^2+3$ is a good number. Because, $y^2+3=2^{k+1}+(y-1)^2$. Now so $(y^2+1,y^2+2,y^2+3,y^2+4)$ are good numbers. $\square$