I want to come up with a closed formula for generating the sequence: $$ \{1,1,3,3,5,5,7,7,9,9,11,11,...\} $$

It is possible to generate the odd numbers by $$ a_n = 2n+1 $$

The problem is to make every term repeat itself once sequentially. The sequence $$ a_n = 2n+(-1)^n $$ generates $\{1,1,5,5,9,9,11,11,\dots\}$.

I can't think of a solution. Is there any?

  • $\begingroup$ The sequence $1,2,3,4,5,\dots$ gets every other number right. Can you think of a way to add something to the (very simple) formula that generates $1,2,3,4,5\cdots$ that corrects the even numbers to match your sequence? $\endgroup$
    – Steve Kass
    Oct 31 '17 at 16:02
  • $\begingroup$ Your average increase is just $1$ so you don't want to multiply $n$ by $2$. What goes wrong with $n+(-1)^n$ as an attempt to correct things, and how can you adjust that to make it work. $\endgroup$ Oct 31 '17 at 16:10
  • $\begingroup$ There are several correct answers to your question. Any of them will be harder for your reader to parse and understand than just seeing the start of the sequence as you have written it. I suggest you just write that. $\endgroup$ Oct 31 '17 at 16:28
  • $\begingroup$ $$a_n=\frac{1}{2} (-1)^n \left((-1)^n (2 n+1)+1\right)$$ $\endgroup$
    – Raffaele
    Oct 31 '17 at 18:02
  • $\begingroup$ Your title seems inconsistent with your sequence, as $1$ occurs only once ... $\endgroup$
    – Bram28
    Nov 1 '17 at 2:17

try this $a_n=\frac{2n+1+(-1)^n}{2}$


We want a function $f$ that gives $f(n)=n$ if $n$ is odd and $f(n)=n+1$ if $n$ is even.

We can let $f(n)=n+g(n)$ where $g$ is a function such that $g(n)=0$ if $n$ is odd and $g(n)=1$ if $n$ is even. We can take a modification of cos to get $g(x)=\cos^2(\frac{\pi x}{2})$.

So we get $f(x)=x+ \cos^2(\frac{\pi x}{2})$

Another posibility for $g(x)$ is $\frac{1}{2} + \frac{(-1)^n}{2}$

  • $\begingroup$ I likek the way you've put a thought process in the deduction of the formula. Will help when trying to deduce other progression formulae. $\endgroup$ Nov 1 '17 at 11:25

If you prefer using the floor function, then $$2\left\lfloor\dfrac{n+1}{2}\right\rfloor+1, n\geq0.$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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