Q:

Formula for sequence of 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4 and so on.

I have been trying to figure out a formula for the sequence: $0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, ...$ and so on . It is not geometric and it is not arithmetic, I tried to apply these formulas, but of them are failing leading me to believe it is sum of arithmetic and geometric, can this be possible? How to get the formula for the sequence?

A:

If you want the sum up to term $n$, the number of triplets up to term $n$ is $\lfloor \frac {n-1}3 \rfloor$, so multiply the sum of the numbers up to that by $3$.  Then add the last one or two numbers, if any.

