Length of integer repeats in an integer square root step function

43 Views Asked by At

Given the step function $f(n)=\lfloor\sqrt{n}\rfloor$ producing the integer sequence $$0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,\ldots $$ I observed (conjecture) that the integers repeat an odd number of times each: $$ 1 \times 0; 3 \times 1; 5 \times 2; 7 \times 3; \ldots; (2i+1) \times i \,.$$ How could one proof such a thing for the infinite sequence? My guess is one has to define a counting function first, based on an indicator function acting on the sequence, and then proof this as a property of the counting function, but I have no idea how one could do this? Does someone know an example maybe, where such a thing has been done before? Or maybe this is known already for the case of integer square roots?

1

There are 1 best solutions below

1
On BEST ANSWER

Note that $m\leq\sqrt n\lt m+1\iff m^2\leq n\leq m^2+2m$, hence $f(n)=m$ for $2m+1$ values of $n$.