TITLE: Formula for the simple sequence 1, 2, 2, 3, 3, 4, 4, 5, 5, ...
QUESTION [9 upvotes]: Given $n\in\mathbb{N}$, I need to get just enough more than half of it. For example (you can think this is : number of games $\rightarrow$ minimum turns to win)
$$ 1 \rightarrow 1 $$
$$ 2 \rightarrow 2 $$
$$ 3 \rightarrow 2 $$
$$ 4 \rightarrow 3 $$
$$ 5 \rightarrow 3 $$
$$ 6 \rightarrow 4 $$
$$ 7 \rightarrow 4 $$
$$ \vdots $$
$$ 2i \rightarrow i+1 $$
$$ 2i+1 \rightarrow i+1 $$
$$ \vdots $$
Is it possible to create a simple formula without piecewise it into odd and even? Sorry for my bad English.

REPLY [64 votes]: How about:
$$
\frac{3+2n+(-1)^n}{4}
$$
or (continuous function of $n \in \mathbb R$ or even $\mathbb C$):
$$
\frac{3+2n+\cos(\pi n)}{4}
$$