*Here’s a really short one. What’s the nth term of this deceptively simple looking sequence?*

*1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6…*

*I’d like a function please, something that I could graph.*

**Extension:** What is the nth term of a sequence with Z identical numbers in a row. The sequence above, for instance has Z = 2. A sequence of Z = 5 would look like this:

*1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, …*

### Like this:

Like Loading...

*Related*

Any chance we coul have a hint? My maths and further maths doesn’t help me here!

Of course!

Try and think of a function that alternates between 2 values.

IyI=x ?

Try y = cos(x)

y=(z^5t)+(8x^k)

I would use (-1)^n as the alternating function, then tweek it a bit

f(x)=[(n+Z-1)/Z], where [c] means the integer part of c ( [2,345]=2 )

nth term = n – |cos(nπ/2)|