# A weird function related to the denominators of rational squares

Between any consecutive integers $a$ and $a+1$ there are infinitely many rational squares of the form $t^2 / s^2$. I have been working to understand the following question: How small can $t$ and $s$ be? That is, let $\sigma (a)$ denote the least natural number $s$ for which there exists a natural number $t$ such that $(s^2)a < t^2 < (s^2)(a + 1)$. What are the properties of the function $\sigma (a)$?

It's not hard to calculate $\sigma (a)$ numerically, and the graph of the function is weird. Full of crazy fluctuations but bounded by a smooth curve both above and below. I've been working on this for a while now and have found some nice partial results, including sharp formulas for the lower and upper bounds, a criterion for when the upper bound is attained, and several special cases. (I'll be happy to share those with anybody who asks.) I am at the point where I think I need to find out if anybody else has worked on this sort of thing before. Standard websearches haven't turned anything up. Does anybody know if this question has been previously investigated?

• I haven't graphed it, but here is a perspective which may help. Set d=2. For positive integers t, tabulate (t/d)^2, and note for what t you will get sigma(a)=d. The answer will depend primarily whether t is odd. Increase d by one and repeat. This time, the t that matter will depend on the previous d, when t/(d+q) is near to s/d and if gcd(t,d+q)=1 or not. You might find Moebius inversion useful in representing sigma. Gerhard "Jacobsthal's Function Might Be Related" Paseman, 2012.10.12 Oct 12 '12 at 15:26
• There is also a suggestion of the logistic map and perhaps a discrete dynamical system. However, I am not an expert on this, so waste only a little time on this idea. Gerhard "Manage Your Time With Ideas" Paseman, 2012.10.12 Oct 12 '12 at 15:32
• Using the perspective of tabulation, I suspect sigma(a) <= 2k for k^2 <= a <= (k+1)^2 - 1. I'll have to think about sigma(k^2+2k) for a bit. Gerhard "Remember Jacobi: When Possible, Invert" Paseman, 2012.10.12 Oct 12 '12 at 15:40
• Oops. Arithmetic error. Likely sigma(k^2 + 2k)=k+1, so you will be interested in the "holes" created by mapping the kth Farey sequence by the square function. Gerhard "I'll Stop Here For Now" Paseman, 2012.10.12 Oct 12 '12 at 15:47
• Maybe I should give some more detail on what I have already found so that people don't waste their time re-inventing my wheel. (1) For all $a$, $\sigma (a) \leq \overline{\frac{8a\sqrt{a}}{4a-1}}$, where the overbar denotes the ceiling function. (2) When $a=n^2$ the upper bound above is sharp, and simplified to $\sigma (n^2) = 2n+1$. (3) When $a=n^2 + n$ we have $\sigma(n^2 + n) = 2$. Oct 12 '12 at 18:31

I found this on the OEIS, but it doesn't list much information, so I don't know whether it's been studied before. One way to look at it is that you're looking for the rational number with the smallest denominator between $\sqrt{n}$ and $\sqrt{n+1}$. There are algorithms that use continued fractions to calculate the "best" rational in any given interval; see here. Square roots have particularly nice continued-fraction representations, so you might even be able to get some sort of formula for $\sigma$.

• Thanks -- those citations will be very helpful, I think. I am a total newbie when it comes to the OEIS; is there a way to search for papers / pages that discuss or reference a specific OEIS sequence? Oct 12 '12 at 22:07
• Not really. Usually, if there's a paper about a sequence, there'll be a reference in the entry for the sequence. Oct 13 '12 at 4:39
• More and more papers are using the modern numbering when referring to an OEIS entry. You can try a web search on that number, but I will be suprised if you find any published more than 8 years ago, if you find any at all. Also, the OEIS organization did a renumbering some years ago; you may have to consider that. Gerhard "Ask Me About System Design" Paseman, 2012.10.15 Oct 15 '12 at 18:09

I think pulling the parts of the range of the square function back to an interval decorated with Farey fractions will help not only with sigma, but also with the question with chi corresponding to the cube or other monotonic polynomial on the positive integers in place of sigma. Sigma is nice to study because there are about (k^2)/3 Farey fractions with denominator at most k, almost ensuring a bound of k for sigma(a) when k^2< a < (k+1)^2. I'll leave a similar bound for higher orders for you to derive.

Even just looking at (k +/- 1/t)^2 for positive integers t helps one understand the behavior of sigma near sigma(k^2); a similar idea was what motivated my comments below.

I do not know where your function has been studied, but I see connections to Farey fractions, rational approximation, and even discrete dynamical systems. Perhaps some of those areas, combined with a suggestion from elsewhwere, will give you what you seek.