Find number of $n\in\{1,2,\dotsc,1000\}$ s.t. $\exists x\in\mathbb{R}^+$ where $x^2+\lfloor x^2\rfloor=n$.

56 Views Asked by At

Find number of $n\in\{1,2,\dotsc,1000\}$ such that $\exists x\in\mathbb{R}^+$ where $x^2+\lfloor x^2\rfloor=n$.

My approach :

As $\lfloor x^2\rfloor$ and $n$ are integers, then $x^2$ is a (positive) integer, say $k$.

As $x^2$ is an integer, therefore $\lfloor x^2\rfloor=x^2$ which implies $n=2x^2=2k$.

Therefore all $n$ that satisfy the statement are even which implies there are $500$ solution for $n$.

But the answer key says there are 516 solutions for $n$.

Clarification for the correct solution (and its method to get to the answer) is appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

Not an answer, but a thing that is too big for a comment.

I ran some Mathematica code to look for solutions to your problem, using the following code:

In[1]:=ParallelTable[
 Solve[{x^2 + Floor[x^2] == n, 
   k - 99 <= n <= k && n \[Element] Integers}, {x}, 
  PositiveReals], {k, 100, 1000, 100}]

And it gave me:

Out[1]={{{x -> ConditionalExpression[1, n == 2]}, {x -> 
    ConditionalExpression[2, n == 8]}, {x -> 
    ConditionalExpression[3, n == 18]}, {x -> 
    ConditionalExpression[4, n == 32]}, {x -> 
    ConditionalExpression[5, n == 50]}, {x -> 
    ConditionalExpression[6, n == 72]}, {x -> 
    ConditionalExpression[7, n == 98]}, {x -> 
    ConditionalExpression[Sqrt[2], n == 4]}, {x -> 
    ConditionalExpression[2 Sqrt[2], n == 16]}, {x -> 
    ConditionalExpression[3 Sqrt[2], n == 36]}, {x -> 
    ConditionalExpression[4 Sqrt[2], n == 64]}, {x -> 
    ConditionalExpression[5 Sqrt[2], n == 100]}, {x -> 
    ConditionalExpression[Sqrt[3], n == 6]}, {x -> 
    ConditionalExpression[2 Sqrt[3], n == 24]}, {x -> 
    ConditionalExpression[3 Sqrt[3], n == 54]}, {x -> 
    ConditionalExpression[4 Sqrt[3], n == 96]}, {x -> 
    ConditionalExpression[Sqrt[5], n == 10]}, {x -> 
    ConditionalExpression[2 Sqrt[5], n == 40]}, {x -> 
    ConditionalExpression[3 Sqrt[5], n == 90]}, {x -> 
    ConditionalExpression[Sqrt[6], n == 12]},

Which are just a few of al the found solutions.

To find the number of solutions I wrote:

In[2]:=ParallelTable[
 Length[Solve[{x^2 + Floor[x^2] == n, 
    k - 99 <= n <= k && n \[Element] Integers}, {x}, 
   PositiveReals]], {k, 100, 1000, 100}]

Out[2]={50, 50, 50, 50, 50, 50, 50, 50, 50, 50}

So, there are $50 + 50 + 50 + 50 + 50 + 50 + 50 + 50 + 50 + 50=500$ solutions to your problem.


EDIT when you've your equation wrong and it is $x^2+\lfloor x\rfloor ^2=\text{n}$ we get:

In[3]:=ParallelTable[
 Length[Solve[{x^2 + Floor[x]^2 == n, 
    k - 99 <= n <= k && n \[Element] Integers}, {x}, 
   PositiveReals]], {k, 100, 1000, 100}]

Out[3]={51, 49, 56, 48, 51, 56, 49, 40, 59, 57}

So it has $51 + 49 + 56 + 48 + 51 + 56 + 49 + 40 + 59 + 57=516$ solutions.