Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently, while learning Python (the programming language), I started playing around to generate the following sequence: $$\lfloor \sqrt{0} \rfloor, \lfloor \sqrt{1} \rfloor, \lfloor \sqrt{2} \rfloor, \lfloor \sqrt{3} \rfloor, \dots$$

Interestingly, this is equivalent to

$$0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, \dots$$

I tried this up to $\lfloor \sqrt{10000} \rfloor$ and saw that every $n \in [0,99]$ occurs exactly $2n+1$ times in the sequence.

Being curious, I'm interested in proving this for all $n \in \Bbb N$ (or finding a counterexample), but I'm not sure how to do this. The only related thing I've found is that determining whether $\lfloor \sqrt{p} \rfloor$ ($p$ is prime) generates all natural numbers is an unsolved problem, but can we do a simple proof of this using all natural numbers? All hints are welcome.

share|cite|improve this question
$\lfloor\sqrt{n}\rfloor = k$ if and only if $k^2 \leqslant n < (k+1)^2$. – Daniel Fischer Apr 27 '14 at 21:28
up vote 9 down vote accepted

HINT : All you need to notice is that $$(n+1)^2 - n^2 = 2n+1$$

share|cite|improve this answer
Well that is just brilliantly simple, thanks! – naslundx Apr 28 '14 at 6:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.