# Find the possible value of $x$ such that $f(x)=K$

Let $f(x)=\lfloor\{\sqrt{x}\}.10^{18}\rfloor$

where $\{x\}=x-\lfloor x\rfloor$ i.e. the fractional part of x, meaning the values after the decimal dot.

For example $\sqrt 3 = 1.7320508075688772935274...$
and $f(3) = 732050807568877293$

Given the value of $f(x)=K$, how can I find any possible value of $x=x_0$ so that $f(x_0)=K$ and $x_0$ is an INTEGER less than $10^{18}$.

• "meaning the values after decimal dot" - This is wrong. $\{-0.3\}=0.7$ Jun 8, 2017 at 16:31
• I am dealing with positive numbers. Jun 8, 2017 at 16:35
• Then it's fine. Jun 8, 2017 at 16:46

Since $\{\sqrt{x}\}\in[0,1[$ then $f(x)=K$ is an integer in the range $0..10^{18}$.

My first thought is to take a rational approximation $\alpha$ of $10^{-18}K\in[0,1]$.

If $x=p^2$ with $p$ integer then $f(p)=0$ so we can assume $p^2<x<(p+1)^2$

This can be rewritten $x=p^2+r$ with $r=1,..,2p$

In that case $\{\sqrt{x}\}=\{\sqrt{p^2+r}\}=\{p\sqrt{1+\frac r{p^2}}\}=\{p(1+\frac{r}{2p^2}+o(\frac r{p^2}))\}=\{\frac r{2p}+o(\frac rp)\}$

If we can find an approximation such that $\alpha=\frac{r}{2p}\simeq 10^{-18}K$ then we should have

$\{\sqrt{x}\}\simeq \alpha$ and $f(x)\simeq K$.

This is just some rough idea, maybe someone can make it work.