n output
2 1
3 1
4 2
5 3
6 3
7 4
8 5
9 6
10 6
11 7
12 8
13 9
14 10
15 10
16 11
17 12
18 13
19 14
I feel mathematically incapable of answering this. I could use floor and ceil by the way. floor rounds to the lowest integer, ceil rounds to the highest integer
I've come close to this pattern.
What I've came up with $$a_n = n - floor(\sqrt{n})+1$$
It aint exactly right.
You could add any conditions by the way, i.e if its even or odd.
Found the answer thx below.
You can have a look at the On-Line Encyclopedia of Integer Sequences which stores a lot of integer sequences with interesting comments, formulas and references.
For this sequence you will find 3 answers . I won't reproduce the formulas they give here but the simplest one is maybe to see this sequence as "the sequence of nonnegative integers with the triangular numbers repeated".