Determine all positive integers $n$ for which $\dfrac{n^2+1}{[\sqrt{n}]^2+2}$ is an integer. Here $[r]$ denotes the greatest integer less than or equal to $r$.
Problem
Source: APMO 2013, Problem 2
Tags: modular arithmetic, inequalities, quadratics, function, algebra, floor function, Hi
04.05.2013 01:15
This was a silly problem; there are no such $n$. Let $n = m^2 + k$ where $0 \le k \le 2m$. Then we require \[ \frac{(m^2+k)^2+1}{m^2+2} = m^2 + (2k-2) + \frac{(k-2)^2+1}{m^2+2} \] to be an integer. Now $(k-2)^2 + 1 < 4m^2 + 8$, and hence $\tfrac{(k-2)^2+1}{m^2+2}$ must be either $1$, $2$ or $3$. We will examine each case. If $(k-2)^2+1 = m^2+2$, then $(k-2)^2 = m^2+1$, which is impossible unless $m=0$ and $k-2 = \pm 1$, so no solution in this case. If $(k-2)^2+1 = 2m^2+4$, then $(k-2)^2 - 2m^2 = 3$. Modulo $3$ we get that $(k-2)^2 + m^2 \equiv 0 \pmod{3}$ which is enough to force $k-2 \equiv m \equiv 0 \pmod{3}$, and yet this implies $9 \mid (k-2)^2 - 2m^2 = 3$, contradiction. Finally, if $(k-2)^2 + 1 = 3m^2 + 6$, then $(k-2)^2 - 3m^2 = 5$. Again, taking modulo $3$, we get $(k-2)^2 \equiv 2 \pmod{3}$ which is not possible. So, no solutions for $n$.
04.05.2013 06:55
It was.. pretty silly... though it was just a bounding argument really.
04.05.2013 07:17
Another way to solve $m^2 + 2 | a^2 +1 $. Notice that if a prime $p$ divides $a^2+1$ then $p$ is of the form $4k+1$. So all prime divisors of $m^2 +2 $ are of the form $4k + 1$. However, this would imply that $m^2 +2 \equiv 1 \pmod 4 \implies m^2 \equiv 3 \pmod 4$, which can't happen. EDIT: V_enhance is right, wrong way to finish the problem.
04.05.2013 07:21
hatchguy wrote: Notice that if a prime $p$ divides $a^2+1$ then $p$ is of the form $4k+1$. So all prime divisors of $m^2 +2 $ are of the form $4k + 1$. However, this would imply that $m^2 +2 \equiv 1 \pmod 4 \implies m^2 \equiv 3 \pmod 4$, which can't happen. If $a$ is even, then it's possible that $m^2 + 2 \equiv 2 \pmod{4} \implies m^2 \equiv 0 \pmod{4}$, which is definitely permissible. In particular, $(m,a) = (12, 27)$ is a solution here.
04.05.2013 07:56
From v_Enhance's solution, we have that $k \leq 2m$, and after some calculations, we have $3k+1 \vdots p^2+2$. Combine these two and use the inequality method, we easily found that there is no solution.
05.05.2013 04:19
Let $m^2$ be the greatest square less than or equal to $n$, then $m^2\leq n<(m+1)^2$. Now let $n=m^2+r$ where $0\leq r<2m+1$. So $[\sqrt{n}]^2=m^2$ and thus \begin{align*}\frac{n^2+1}{[\sqrt{n}]^2+2} &=\frac{(m^2+r)^2+1}{m^2+2}\\ &=\frac{m^4+2m^2r+r^2+1}{m^2+2} \\ &=m^2+\frac{2m^2r+r^2+1-2m^2}{m^2+2} \\ &=m^2+(2r-2)+\frac{r^2+1-4r+4}{m^2+2} \\ &=m^2+2r-2+\frac{r^2-4r+5}{m^2+2} \end{align*} We place a bound on the numerator: \[r^2-4r+5\leq (2m+1)^2-4(2m+1)+5=4m^2-4m+2< 4(m^2+2).\] Therefore in order for the expression to be an integer, we must have \begin{align*}r^2-4r+5=(r-2)^2+1&=\{m^2+2, 2m^2+4, 3m^2+6\} \\ (r-2)^2&=\{m^2+1, 2m^2+3, 3m^2+5 \} \end{align*} The first case $m^2+1$ is impossible since there are no two consecutive numbers that are squares. The second case is impossible by taking modulo $8$ since the quadratic residues modulo $8$ are $0, 1,$ and $4$, then $2m^2+3$ can be congruent to $3, 5, 3$, none of which are quadratic residues. And the last case take modulo $3$ and see that $3m^2+5$ is congruent to $2$ modulo $3$ which is not a quadratic residue. Therefore there are no such integers $n$. $\blacksquare$
10.01.2014 07:50
Let $n = m^2 + k$, where $0 \le k \le 2m$. Therefore, $[\sqrt{n}] = m$. We are therefore trying to see when $\frac{m^4 + 2m^k + k^2 + 1}{m^2 + 2}$ is an integer. We rewrite the fraction as $m^2 + 2k-2 + \frac{k^2 - 4k + 5}{m^2 + 2}$. So we want $m^2 + 2 | k^2 - 4k + 5$. But notice that since $k \le 2m$, we have $k^2 - 4k + 5 \le k^2 + 5 \le 4m^2 + 5$. Therefore, if $\frac{k^2 - 4k + 5}{m^2 + 2}$ is an integer, then it is either $1, 2, 3$. We now go through the casework: Case 1: the integer is 1: Therefore, $k^2 - 4k + 5 = m^2 + 2$ which leads to $(k-2)^2 = m^2 + 1$. The only squares the differ by $1$ are $0$ and $1$. which would give us $m = 0$, contradiction. There are no solutions for this case. Case 2: the integer is 2: We then have $(k-2)^2 = 2m^2 + 3$. Let $a = k-2$ and $b = m$. Then, we have $a^2 - 2b^2 = 3 \Rightarrow a^2 \equiv 2b^2 \pmod{3}$. Since $\left( \frac{2}{3} \right) = -1$, we see that $3|a, b$ but then $9|a^2 - 2b^2 \Rightarrow 9|3$, yet another contradiction. There are no solutions for this case. Case 3: the integer is 3: We then have $(k-2)^2 = 3m^2 + 5$ which would give us $(k-2)^2 \equiv 2 \pmod{3}$, yet another contradiction. Therefore, there are no solutions at all.
07.12.2014 03:25
At v enhance, what was your reasoning behind defining m and k? I don't understand. Please explain.
07.12.2014 09:07
Basically, it's so that you don't have the floor function of the square root hanging around, as it is annoying to deal with. So you let $[\sqrt{n}]=m$, i.e. $m^2 \leq n \leq (m+1)^2-1 = m^2+2m$. We can then let $n=m^2+k$ where $0 \leq k \leq 2m$. The rest of the solution is then standard divisibility ideas and bounding.
10.12.2014 04:41
leminscate wrote: Basically, it's so that you don't have the floor function of the square root hanging around, as it is annoying to deal with. So you let $[\sqrt{n}]=m$, i.e. $m^2 \leq n \leq (m+1)^2-1 = m^2+2m$. We can then let $n=m^2+k$ where $0 \leq k \leq 2m$. The rest of the solution is then standard divisibility ideas and bounding. Interesting, thank you for pointing that out. Would the k be just some unknown constant?
10.12.2014 04:44
yes
13.01.2016 17:52
if we divide by the usual method of long division we get remainder as$p^2-4p+5=0$ where$ p$ is the $r $used by gandora but $p$ is not an integer. We can even generalise it...
08.03.2016 21:13
My solution: Let $n=x^2+2k$ where $0\le k\le 2x$; then $\lfloor \sqrt{n}\rfloor^2=x^2$ so we want to find when $\dfrac{(x^2+k)^2+1}{x^2+2}$ is integral. After polynomial division this is equivalent to finding when $\dfrac{(k-2)^2+1}{x^2+2}$ is integral. Since $(k-2)^2+1 \le (2x-2)^2+1 < 4(x^2+2)$, we have three cases: Case 1: $(k-2)^2+1=x^2+2$. In this case $(k-2)^2=x^2+1$ clear contradiction. Case 2: $(k-2)^2+1=2(x^2+2)$. In this case $(k-2)^2-3=2x^2$; taking mod 8 gives the LHS equal to 1, 5, or 6 mod 8 and the only possible one is 6 mod 8. But then $2x^2\equiv 6\pmod{8}\implies x^2\equiv 3\pmod{4}$ contradiction. Case 3: $(k-2)^2+1=3(x^2+2)$. In this case $(k-2)^2-5=3x^2$. Taking mod 9, the LHS can be 4, 5, 8, or 2 mod 9 which are all impossible, contradiction. Thus there are no solutions. EDIT: oops v_Enhance pointed out above that taking mod 3 for cases 2 and 3 suffice...
17.04.2016 19:43
v_Enhance wrote: This was a silly problem; there are no such $n$. Let $n = m^2 + k$ where $0 \le k \le 2m$. Then we require \[ \frac{(m^2+k)^2+1}{m^2+2} = m^2 + (2k-2) + \frac{(k-2)^2+1}{m^2+2} \]to be an integer. Now $(k-2)^2 + 1 < 4m^2 + 8$, and hence $\tfrac{(k-2)^2+1}{m^2+2}$ must be either $1$, $2$ or $3$. We will examine each case. If $(k-2)^2+1 = m^2+2$, then $(k-2)^2 = m^2+1$, which is impossible unless $m=0$ and $k-2 = \pm 1$, so no solution in this case. If $(k-2)^2+1 = 2m^2+4$, then $(k-2)^2 - 2m^2 = 3$. Modulo $3$ we get that $(k-2)^2 + m^2 \equiv 0 \pmod{3}$ which is enough to force $k-2 \equiv m \equiv 0 \pmod{3}$, and yet this implies $9 \mid (k-2)^2 - 2m^2 = 3$, contradiction. Finally, if $(k-2)^2 + 1 = 3m^2 + 6$, then $(k-2)^2 - 3m^2 = 5$. Again, taking modulo $3$, we get $(k-2)^2 \equiv 2 \pmod{3}$ which is not possible. So, no solutions for $n$. Or I think you can look at the second case modulo 8...
19.06.2018 14:13
12.10.2019 15:52
v_Enhance wrote: Determine all positive integers $n$ for which $\dfrac{n^2+1}{[\sqrt{n}]^2+2}$ is an integer. Here $[r]$ denotes the greatest integer less than or equal to $r$. Solution: Let $n=k^2+l$ with $l \leq 2k$. So we have $k^2+2|(k^2+l)^2+1$ or $k^2+2|k^4+2k^2l+l^2+1$. As $k^2+2|k^4-4$ and $k^2+2|2k^2l+4l$ we get that $k^2+2|l^2+4l+5=(l+2)^2+1$. If $k$ is odd then $k^2+2$ is $3$ mod $4$ but since $(l+2)^2+1$ has no divisor of the form $4k+3$ this gives a contradiction. So let $l=2m$. Thus $4m^2+2|(l+2)^2+1$. So $l$ is odd so let $l=2s-1$ for some $n$. So we have $2m^2+1|2s^2+2s+1$. We get that $s \leq n$ or $s \leq 2m$. Thus $2s^2+2s+1 \leq 8m^2+8m+1 \leq 9m^2+1$ for $m \geq 8$. So for $m \geq 8$ if $2s^2+2s+=k(2m^2+1)$ then $k$ is odd, obviously $k \neq 1$ as $s^2+s$ can never be equal to $m^2$ for positive integers $m,s$, and $k \leq 4$. So we have $k=3$. So we get that $3|2s^2+2s+1$ which is a contradiction by mod $3$ check. Thus $m<8$ if $2m^2+1|2s^2+2s+1$. One can easily check that no solutions exist for $m<8$. Hence no solutions for $m$ exist. Thus no solutions for the original problem exist
08.03.2020 03:01
v_Enhance wrote: hatchguy wrote: Notice that if a prime $p$ divides $a^2+1$ then $p$ is of the form $4k+1$. So all prime divisors of $m^2 +2 $ are of the form $4k + 1$. However, this would imply that $m^2 +2 \equiv 1 \pmod 4 \implies m^2 \equiv 3 \pmod 4$, which can't happen. If $a$ is even, then it's possible that $m^2 + 2 \equiv 2 \pmod{4} \implies m^2 \equiv 0 \pmod{4}$, which is definitely permissible. In particular, $(m,a) = (12, 27)$ is a solution here. You probably wish to say "If $a$ is odd".
11.02.2021 18:09
The answer is that there is no such $n$. We first let $n=a^2+b$, where $0 \leq b \leq 2a$. Then, we need: $$\frac{(a^2+b)^2+1}{a^2+2}=a^2+2(b-1)+\frac{(b-2)^2+1}{a^2+2}$$to be an integer. This is equivalent to saying $\tfrac{(b-2)^2+1}{a^2+2}$ is an integer, call this $k$. We now consider the following cases on which integer $k$ is: Case 1: $k=1$. Then we need $(b-2)^2=a^2+1$. However, the only consecutive perfect squares are $0,1$, which implies $(b-2)^2=1$ and $a=0$. But since $0 \leq b \leq 2a$, we also need $b=0$ which is a contradiction. Case 2: $k=2$. Then we need $(b-2)^2=2a^2+3$. Now take $\pmod{3}$, which shows that the LHS is either $0,1$ and the RHS is either $0,2$. This implies that $b \equiv 2 \pmod{1}$ and $a \equiv 0 \pmod{3}$, so $a=3m$ and $b=3n+2$ for some positive integers $m,n$. When we substitute, the equation becomes: $$9n^2=18m^2+3$$wherupon taking $\pmod{9}$ implies that no solutions exist. Case 3: $k=3$. Then we need $(b-2)^2+1=3a^2+6$. Taking $\pmod{3}$, the LHS is either $1,2$ and the RHS is $0$, so no solutions exist in this case. Case 4: $k \geq 4$. This implies $(b-2)^2+1=ka^2+2k$. But for $a \geq 2$ we have: \begin{align*} (b-2)^2+1&\geq (2a-2)^2+1\\ &\geq (2a)^2+1\\ &\geq 4a^2+1\\ &\geq ka^2+1\\ &> ka^2+2k \end{align*}so equality never holds (the reason we need $a \geq 2$ is because the first inequality is not true if $a=1$ and $b=0$, for instance). If $a=1$ the LHS is still less than the RHS, since the LHS is at most $2^2+1=5$ and the RHS is at least $12$. Thus there are no solutions in this case either. Combining these cases finishes. $\blacksquare$
22.05.2021 23:47
v_Enhance wrote: Determine all positive integers $n$ for which $\dfrac{n^2+1}{[\sqrt{n}]^2+2}$ is an integer. Here $[r]$ denotes the greatest integer less than or equal to $r$. Problem not common . Assume that exists solutions: It is known that $f(x)=x^2+c$ is surjective on $x \in \mathbb Z^+$. So we can let $n=a^2+b$ where $0 \le b \le 2a$ and hence $[\sqrt{n}]=a$ now lets use these informations: $$a^2+2 \mid a^4+2a^2b+b^2+1 \implies a^2+2 \mid (b-2)^2+1$$$$b-2 \le 2(a-1) \implies (b-2)^2+1 \le 4a^2-8a+5<4a^2+8=4(a^2+2)$$That means $k(a^2+2)=(b-2)^2+1$ where $k \in (1,3)$ Case 1.- $k=1$ $$(b-2)^2=a^2+1 \implies (b-1)(b-3)=a^2 \implies b=4 \implies a^2=3 \; \text{contradiction!!}$$Case 2.- $k=2$ $$(b-2)^2 \equiv 2a^2+3 \pmod 3 \implies 9 \mid (b-2)^2 \; \text{and} \; 9 \mid a^2$$$$(b-2)^2-2a^2=3 \implies 3 \equiv 0 \pmod 9 \; \text{contradiction!!}$$Case 3.- $k=3$ $$(k-2)^2+1 \equiv 0 \pmod 3 \; \text{contradiction!!}$$Hence no such positive integers. Thus we are done
23.05.2021 01:47
If $n=m^2+k,k\in[0,2m]\cap\mathbb Z,m\in\mathbb Z$ then we have: $$\frac{k^2-4k-3}{m^2+2}+m^2+2k-2\in\mathbb Z.$$By the aforementioned bounds, we obtain $\frac{k^2-4k-3}{m^2+2}\in\{1,2,3\}$. $\textbf{Case 1: }\frac{k^2-4k-3}{m^2+2}=1$ $\Leftrightarrow(k-2)^2-m^2=1$, and it's well-known that the only squares which are one apart are $0$ and $1$, but there are no solutions here after testing $k\in\{1,3\}$, $m=0$. $\textbf{Case 2: }\frac{k^2-4k-3}{m^2+2}=2$ We have $(k-2)^2=2m^2+3$, now$\pmod3$ gives that $k\equiv2$ and $m\equiv0$. Now $v_3(\text{LHS})\ge2$ while if $m=3n$, $v_3(\text{RHS})=v_3(3(6n^2+1))=1$, so no solutions. $\textbf{Case 3: }\frac{k^2-4k-3}{m^2+2}=3$ So $(k-2)^2=3m^2+5$, by$\pmod5$ we have $(k-2)^2\equiv3m^2$, which enforces $k\equiv2$ and $m\equiv0$. Then $v_5(\text{LHS})\ge2$ while, if $m=5n$, $v_5(\text{RHS})=v_5(5(15n^2+1))=1$, contradiction. No $n$ satisfy this condition. $\square$
23.05.2021 04:27
Similar solution to everyone else, written in a hurry though. Let $n=k^2+m$, where $k,m$ are both nonnegative integers and $m \in [0,2k]$. We have that $\frac{{(k^2+m)}^2+1}{k^2+2} = k^2+2m-2+\frac{m^2-4m+5}{k^2+2}$ needs to be an integer, so $\frac{m^2-4m+5}{k^2+2}$ needs to be an integer. Since $m \in [0,2k]$, we have that $\frac{m^2-4m+5}{k^2+2}$ can only be $1,2,$ or $3$. I claim that it can't be any. If the quantity is equal to $1$, we have that ${(m-2)}^2 = k^2+1$, and this clearly holds false. If the quantity equals to $2$, we have that ${(m-2)}^2=2k^2+3$. Observing this in mod $3$, we see that $m \equiv 2 \mod 3$ and $k \equiv 0 \mod 3$. Let $m=3m'+2$ and $k=3k'$. Substituting these values in we get that $3{(m')}^2=6{(k')}^2+1$, which clearly isn't possible again by observing in modulo $3$. If the quantity is equal to $3$, we have that ${(m-2)}^2=3k^2+5$. The right hand side is equal to $2 \mod 3$, hence this is absurd. From this we have that $\frac{m^2-4m+5}{k^2+2}$ can never be an integer, so there exist no solutions for $n$. $\blacksquare$
12.09.2021 10:12
There is no such $n$. Let $k = \lfloor \sqrt{n} \rfloor$ and $n = k^2 + \ell$ for some $0 \leqslant \ell \leqslant 2k$. Clearly $k^2 + 2 \mid (\ell-2)^2+1$. Due to clear size reasons the quotient of the last divisibility cannot exceed $3$. When the quotient exceeds $1$ working mod $3$ yields contradiction and when the quotient is $1$ there is only one possibility; which fails as well.
27.10.2021 17:20
23.02.2022 00:40
21.05.2022 04:34
There are no such $n$. Let $n=m^2+c$, where $0\le c\le 2m$. We have $\frac{(m^2+c)^2+1}{m^2+2}$ is an integer. Note that $m^2+c\equiv c-2\pmod{m^2+2}$. So $\frac{(c-2)^2+1}{m^2+2}$ is a positive integer. Now, \[(c-2)^2+1\le (2m-2)^2+1=4m^2-8m+5<4m^2+8=4(m^2+2)\] Since $(c-2)^2+1$ and $m^2+2$ are positive, we have \[\frac{(c-2)^2+1}{m^2+2}\in \{1,2,3\}\] Case 1: $(c-2)^2+1=m^2+2$. Then $m^2+1$ is a perfect square, which is not possible as $m>0$. Case 2: $(c-2)^2+1=2m^2+4$. Then $2m^2+3$ is a perfect square. Note that $m^2\in \{0,1,4\}\pmod 8$, so $2m^2+3\in \{3,5\}\pmod 8$, both are not QR's. Case 3: $(c-2)^2+1=3m^2+6$. Then $3m^2+5$ is a perfect square. Clearly not possible as it is $2\pmod 3$. We have exhausted all cases, so we are done.
09.12.2022 12:45
I claim that there are no such solutions. In order to remove not so beautifull integer function, let $n=a^2+b$ where $ 0 \le b \le 2a$. Our question turns into $$ \frac{a^4+b^2+2a^2b+1}{a^2+2} \in \mathbb{Z}$$Long division yields $$A= \frac{ b^2-4b+5}{a^2+2} \in \mathbb{Z}$$Since $b \le 2a$, the maximum value our expression can get is $$ \frac{ 4a^2-8a+5}{a^2+2}= \frac{ 4a^2+8-8a-3}{a^2+2}= 4 - \frac{8a+3}{a^2+2} \in \{1,2,3 \}$$Hence we will divide into cases \begin{align*} & \text{if} \ A=1 : b^2-4b+5=a^2+2 \Rightarrow (b-2-a)(b-2+a)=1 \Rightarrow \ \text{ no solutions} \\ & \text{if} \ A=2: b^2-4b+5=2a^2+4 \Rightarrow (b^2-2)^2-2a^2=3, \ \text{taking $\mod 8$, no solutions} \\ & \text{if} \ A=3: b^2-4b+5=3a^2+6 \Rightarrow (b^2-2)^2-3a^2=5 \ \text{ taking $\mod 3$, no solutions} \end{align*}Hence we have proven our claim, therefore we are done.
20.01.2023 06:28
Let $n=a^2+r$ with $0\le r\le 2a$; note that $a\ge 1$. Clearly we obtain \[a^2+2\mid (r-2)^2+1\]and by bounding we obtain either \[(r-2)^2=a^2+1\]\[(r-2)^2=2a^2+3\]\[(r-2)^2=3a^2+5\]and the first equation fails by DOS, the second by noting that we must have $3\mid a$ implying that $\nu_3(2a^2+3)=1$, and the third by simply taking $\pmod 3$. We are done. $\blacksquare$
09.03.2023 22:16
The answer is that no $n$ works. If $x=\left\lfloor\sqrt n\right\rfloor$, then $x^2\le n\le x^2+2x$. Let $n=x^2+r$, then \[\frac{n^2+1}{\left\lfloor\sqrt n\right\rfloor^2+2}=\frac{(x^2+r)^2+1}{x^2+2}\rightarrow x^2+2\mid (r-2)^2+1.\] But $(r-2)^2+1<4(x^2+2)$, so \[\frac{(r-2)^2+1}{x^2+2}\in\{1,2,3\}.\] Case 1. It is $1$. Then $(r-2)^2=x^2+1$, so $(r-2-x)(r-2+x)=1$. So $r-2-x=r-2+x$, so $x=0$, absurd as $n$ is positive. Case 2. It is $2$. Then $(r-2)^2=2x^2+3$, but taking mod $8$ yields a contradiction. Case 3. It is $3$. Then $(r-2)^2=3x^2+5$, but taking mod $3$ yields a contradiction. As we have reached a contradiction in all cases, we are done.
27.04.2023 22:13
We show that there are no such $n$. Let $[\sqrt{n}]=k$. Then, $n=k^2+l$ where $0\leq l\leq2k\Longrightarrow n^2=k^4+2k^2l+l^2$ Then, $(k^2+2)\mid(k^4+2k^2l+l^2+1)\Longrightarrow(k^2+2)\mid(l^2-4l+5)$ $$\Longrightarrow1+(l-2)^2=m(k^2+2)$$Note that $m\geq1$ and $1+(l-2)^2\leq1+(2k-2)^2=m(k^2+2)=4k^2-8k+5<4(k^2+2)$ So, $m\in\{1,2,3\}$. For $m=1$, we get $1+(l-2)^2=k^2+2$ which yields no solutions. For $m=2$, we get $1+(l-2)^2=2k^2+4\Longrightarrow(l-2)^2-2k^2=3$. But $2k^2\equiv0,2\pmod{8}\Longrightarrow(l-2)^2\equiv3,5\pmod{8}$, a contradiction as $(l-2)^2\equiv0,1,4\pmod{8}$. For $m=3$, we get $1+(l-2)^2=3k^2+6\Longrightarrow(l-2)^2\equiv2\pmod{3}$ which is impossible as $(l-2)^2\equiv0,1\pmod{3}$. Therefore, there are no solutions.
04.07.2023 08:01
We claim that there are no solutions. Claim 1: The equation $a^2-2b^2=3$ has no integer solutions. $a^2$ is either 0 or 1 mod 3, and $-2b^2\equiv b^2$ is also either 0 or 1 mod 3. For the total to be a multiple of 3, both have to be 0 mod 3, so $a$ and $b$ are both multiplies of 3, so the LHS is a multiple of 9, contradiction. Claim 2: The equation $a^2-3b^2=5$ has no integer solutions. $a^2$ is either 0, 1, or 4 mod 5, and $-3b^2\equiv 2b^2$ is either 0, 2, or 3 mod 5. The only way for the total to be 0 mod 5 is if both $a$ and $b$ are multiples of 5, so the LHS is a multiple of 25, contradiction. The equation is clearly not true for $n=1,2,3$. From now on, suppose $n\geq 4$. Suppose that $n=k^2+s$ for a positive integer $k\geq 2$ and nonnegative integer $s$ such that $s\leq 2k$ (essentially make $k$ as large as possible). Then, $$\frac{n^2+1}{\lfloor \sqrt{n}\rfloor ^2+2}=\frac{(k^2+s)^2+1}{k^2+2}=(k^2+2s-2)+\frac{s^2-4s+5}{k^2+2}.$$Thus, $$s^2-4s+5\equiv 0\pmod{k^2+2}$$$$(s-2)^2\equiv -1\pmod{k^2+2}.$$Then, note that $$(s-2)^2\leq (2k-2)^2<4k^2<4k^2+7,$$so we must have one of $$(s-2)^2=k^2+1$$$$(s-2)^2=2k^2+3$$$$(s-2)^2=3k^2+5.$$The first one clearly cannot happen as a positive square plus 1 is never a square, while the other two cannot happen by Claims 1 and 2, so we are done.
21.08.2023 06:25
There are no solutions. The key idea is to let $n = m^2+k$ where $0 \leq k \leq 2m$. Note that this implies that $\lfloor\sqrt{n}\rfloor = m$. Note that we require $$m^2+2 \mid n^2+1 = (m^2+k)^2+1$$Note that we can rewrite this as $$(m^2+k)^2+1 \equiv 0 \pmod {m^2+2}$$Equivalently, $$(k-2)^2+1 \equiv 0 \pmod {m^2+2}$$so we are left with $$m^2+2 \mid (k-2)^2+1$$ The key observation is that $4(m^2+2) > (2m-2)^2+1 \geq (k-2)^2+1$. This is trivial to prove. It suffices to check three cases. Case 1: $(k-2)^2+1 = m^2+2$ Difference of squares gives us $(k-2+m)(k-2-m) = 1$ from which we get $k-2-m = 1$ and $k-2+m = 1$. This yields that $m = 0$ so there are no solutions. Case 2: $(k-2)^2+1 = 2(m^2+2)$. Rearranging yields $(k-2)^2 = 2m^2+3$. We will prove that $2m^2+3$ cannot be a square. Note that if $3 \nmid m$ then $2m^2+3 \equiv 2 \pmod 3$ which is bad. So let $m = 3c$ such that $2m^2+3 = 18c^2+3 = 3(6c^2+1)$. However, this means that $3 \mid 6c^2+1$ which is clearly false. Therefore, $2m^2+3$ cannot be a square and there are no solutions for this case. Case 3: $(k-2)^2+1 = 3(m^2+2)$. Rearranging yields $(k-2)^2 = 3m^2+5$. Note that since $3m^2+5 \equiv 2 \pmod 3$ we know that $3m^2+5$ cannot be a square and there are no solutions in this case. We've exhausted all cases and shown that there are no solutions.
04.09.2023 19:47
Let $n = m^2 + k$ s.t. m is maximal but k stays a positive integer; we want \[\frac{(m^2+k)^2+1}{m^2+2} = m^2 + (2k-2) + \frac{(k-2)^2+1}{m^2+2}\in\mathbb{Z}.\]Since $(k-2)^2 + 1 < 4m^2 + 8$, we only need to compute if the fraction equals 1,2,3. Case 1. $(k-2)^2+1 = m^2+2\rightarrow(k-2)^2 = m^2+1$, which is impossible unless $m=0\rightarrow n=0$, contradiction. Case 2. $(k-2)^2+1 = 2m^2+4\rightarrow (k-2)^2 + m^2 \equiv 0 \pmod{3}\implies k-2 \equiv m \equiv 0 \pmod{3}\implies 9 \mid (k-2)^2 - 2m^2 = 3$, contradiction. Case 3. $(k-2)^2 + 1 = 3m^2 + 6\rightarrow(k-2)^2 \equiv 2 \pmod{3}$, contradiction. We've exhausted all cases, so there is no solution for such n.
04.10.2023 19:12
This is so boring problem. Answer: There is no such $n$. Let $x = \left\lfloor \sqrt n \right\rfloor$, and let $y = n - x^2$. Then the condition becomes $\frac{(x^2 + y)^2 + 1}{x^2 + 2}$ is an integer and $y \le 2x$. Thus $x^2 + 2 \mid (y - 2)^2 + 1$. Since $(y - 2)^2 + 1 < (2x - 2)^2 + 1 < 4x^2 + 8$, so $\frac{(y - 2)^2}{x^2 + 2} \in \{1, 2, 3\}$. If $3(x^2 + 2) = (y - 2)^2 + 1$, then $3 \mid (y - 2)^2 + 1$, a contradiction. If $2(x^2 + 2) = (y - 2)^2 + 1$, then $2x^2 + 3 = (y - 2)^2$. So taking mod 3 forces $3 \mid x , (y - 2)$. Then taking mod 9 gives $9 \mid 3$, a contradiction. If $(x^2 + 2) = (y - 2)^2 + 1$, then $x^2 + 1 = (y - 2)^2$, so $x = 0$ and $y = 3$. This contradicts $y \le 2x$. This completes proof. $\blacksquare$
09.10.2023 07:02
Let $n = k^2 + m$ for $0 \le m \le 2k$. This then becomes \[ \frac{(k^2 + m)^2 + 1}{k^2 + 2} = \frac{k^4 + 2k^2m + m^2 + 1}{k^2 + 2} = k^2 - 2 + 2m + \frac{m^2 - 4m + 5}{k^2 + 2} \]This implies that $t(k^2 + 2) = m^2 - 4m + 5$ for $t \in \{1, 2, 3\}$. If $k^2 + 2 = (m - 2)^2 + 1$, then $(k, m) = (0, 3)$, which is invalid. If $2k^2 + 4 = (m - 2)^2 + 1$, taking $\pmod{8}$ gives no solutions. If $3k^2 + 6 = (m - 2)^2 + 1$, taking $\pmod{3}$ gives no solutions.
16.12.2023 23:05
No such $n$ exist. Let $\lfloor \sqrt n \rfloor = k$ and set $n = k^2+r$, where $r \leq 2k$. The divisibility condition $$k^2+2 \mid (k^2+r)^2 + 1 \iff k^2+2 \mid r^2-4r+5$$after some reduction. In particular, this implies that $$r^2-4r+5 \in \{k^2+2, 2k^2+4, 3k^2+6\}.$$ If $r^2-4r+5=k^2+2$, then $k^2+1$ must be a square, which is impossible. If $r^2 -4r + 5 = 2k^2+4$, then $2k^2+3$ must be a square, which is impossible by mod $8$. If $r^2-4r + 5 = 3k^2+6$, then $3k^2+5$ must be a square, which is impossible by mod $3$. Thus there are no valid pairs $(r, k)$ and thus no valid $n$.
28.12.2023 22:53
This problem is so annoying that you have to do nothing else apart from doing some hell lot of bounding stuff (at least that is what I did in the way I solved it). Please let me know if there are any calculation mistakes since it is my nature to make sillies in all possible ways. I claim that there does not exist any such $n$. Let $k^2 \le n < (k+1)^2$. Then using the floor function inequalities, we get, \[ \dfrac{k^4+1}{k^2 + 2}\le \dfrac{n^2 + 1}{k^2 + 2} \le \dfrac{(k+1)^4 + 1}{k^2 + 2}. \] Now we have that $\dfrac{k^4+1}{k^2+2}=k^2 - 2 + \dfrac{5}{k^2+2} > k^2 -2$. This gives us that $\dfrac{n^2 + 1}{k^2 + 2} \ge k^2 - 1$. Also, we have that $\dfrac{(k+1)^2 + 1}{k^2 + 2} = k^2 + 4k + 4 - \dfrac{4k+6}{k^2+2} < k^2 + 4k + 4$. This gives us $\dfrac{n^2 + 1}{k^2 + 2} \le k^2 + 4k + 3$. Combining these two bounds, we get, \[ k^2 - 1 \le \dfrac{n^2 + 1}{k^2 + 2} \le k^2 + 4k + 3. \] Thus we get $(k^2-1)(k^2+2) - 1 \le n^2 \le (k^2+4k+3)(k^2+2) - 1$, that is $k^4 + k^2 -3 \le n^2 \le k^4 + 4k^3 + 5k^2 + 8k + 5$. Now we first need to find all the set of possible perfect squares in the interval $[k^4 + k^2 -3, k^4 + 4k^3 + 5k^2 + 8k + 5]$. Now we can note that all the perfect squares in this range are $\left\{(k^2+1)^2, (k^2+2)^2, \ldots, (k^2 + 2k + 2)^2\right\}$. This gives us that $n\in \left\{k^2+1,k^2+2,\ldots, k^2+2k+2\right\}$. Now we denote $n$ as $(k^2 + i)$ where $1 \le i \le 2k+2$. Since $\dfrac{n^2 + 1}{k^2 + 2}$ is an integer, we get that $k^2 + 2\mid n^2 + 1$, that is, \[ k^2 + 2 \mid (k^2 + i)^2 + 1 \equiv (-2 + i)^2 + 1. \] Now note that $1 \le (i-2)^2 + 1 \le 4k^2 + 1$ which gives that the only possible values for $(i-2)^2 + 1$ are $\left\{k^2+2,2k^2+4,3k^2+6\right\}$. Now among these possibilities, $(i-2)^2 + 1 = 2k^2 + 4$ fails due to $\mod 8$. Also, $(i-2)^2 + 1 = 3k^2 + 6$ fails due to $\mod 3$. Thus we must have $(i-2)^2 + 1 = k^2 + 2 \implies (i-2+k)(i-2-k) = 1$. This is only possible if $k = 0$. So now we are working with $0^2 \le n < 1^2$ which forces $n=0$, contradiction as $n$ was a positive integer.
04.03.2024 02:57
The answer is there is no such $n$. Suppose otherwise, then $n = k^2 + s$ where $0 \leq s < 2k + 1$ and $k = \lfloor \sqrt{n} \rfloor$. Now we have $\frac{(k^2+s)^2 + 1}{k^2 + 2} \in \mathbb{Z}$, so by plugging in $k^2 = -2$ (i.e. long division), we have: $\frac{(s-2)^2 + 1}{k^2 + 2} \in \mathbb{Z}$. Now notice we must have: $(s-2)^2 = k^2 +1, 2k^2 + 3, 3k^2 + 5$, since the numerator is positive and $4k^2 + 7 > 4k^2-4k + 1 \geq (s-2)^2$. These cases each fail by $k \geq 1$, modulo $8$, modulo $3$ respectively, so there are no solutions.
11.03.2024 23:45
Let $n=a^2+b$, where $0 \leq b \leq 2a$. Then $a^2+2$ must divide \[a^4+2a^2b+b^2+1 \implies 2a^2b-2a^2+b^2+1 \implies b^2-4b+5.\] Due to our bound on $b$, we require $\frac{b^2-4b+5}{a^2+2} \in \{1,2,3\}$, which gives the solutions \[b = \sqrt{2a^2+3}+2, \quad \sqrt{3a^2+5}+2.\] Testing modulo 3, neither solutions are integers, giving us $\boxed{\text{no solutions}}$. $\blacksquare$
25.04.2024 20:34
set $\lfloor \sqrt{n} \rfloor :=k$ so we have $k^2 \leqslant n < (k+1)^2$ , so we have $n:=k^2+t$ where $0 \leqslant t<2k$we have: $\frac{n^2+1}{(\lfloor \sqrt{n} \rfloor)^2+2}=\frac{k^4+t^2+2k^2t+1}{k^2+2} \in \mathbb{N} \implies \frac{t^2+5-4t}{k^2+2} \in \mathbb{N}$ now we have the bound: $\frac{2}{k^2+2} \leqslant \frac{(t-2)^2+1}{k^2+2} \leqslant \frac{4k^2+5-8k}{k^2+2}<4$ so we just need to check for $\frac{(t-2)^2+1}{k^2+2} \in \{1,2,3\}$ so we just check that $(t-2)^2=k^2+1,2k^2+3,3k^2+5$ has no solutions , and so no such $n$ works. $\square$
04.05.2024 17:13
08.08.2024 09:47
Let $n=k^2+a$ where $0\le a\le 2k$ and $k>0$. Then we want $$\frac{(k^2+a)^2+1}{k^2+2}=\frac{k^4+2ak^2+a^2+1}{k^2+2}$$to be an integer. Subtracting $k^2+2a-2$ means we want $\frac{a^2-4a+5}{k^2+2}=\frac{(a-2)^2+1}{k^2+2}$ to be an integer. Since $0\le a\le 2k$, we must have that the fraction is $1$, $2$, or $3$. $(a-2)^2+1=k^2+2$ gives $(a-2-k)(a-2+k)=1$, which is not possible. $(a-2)^2+1=2k^2+4$ gives $(a-2)^2=2k^2+3$. Since squares are never $2\pmod{3}$, let $k=3j$ and $a-2=3b$. Then, $9b^2=18j^2+3$ so $3b^2=6j^2+1$. This is clearly not possible because $3\not|1$. $(a-2)^2+1=3k^2+6$ gives $(a-2)^2=3k^2+5$. Since perfect squares are $0,\pm1\pmod{5}$, let $k=5j$ and $a-2=5b$. Then $25b^2=75j^2+5$ so $5b^2=15j^2+1$. This is clearly not possible because $5\not|1$. Therefore, there are no solutions for $n$.
13.02.2025 12:24
Let $\lfloor \sqrt n \rfloor=t$ and $r$ be such that $0\leq r< 2t+1$ and $n=r+t^2$. Now we have $$t^2+2 \mid (r+t^2)^2+1 \implies t^2+2\mid (r-2)^2+1.$$Note that $4(t^2+1)>(2t)^2+1>(r-2)^2+1$. If $3(t^2+2)=(r-2)^2+1$ or $2(t^2+2)=(r-2)^2+1$ then $\pmod 3$ and $\pmod 8$, respectively, yield contradictions. If $t^2+2=(r-2)^2+1$ then $t=0, r=3$ which is not possible. Thus no solutions exist.