Out of pure interest, I would like to be able to construct a sequence as such:

1, 2, 4, 6, 3, 8, 10, 12, 5, 14, 16 ,18, 7, ...

Thus an odd number, followed by three even numbers, followed by an odd number, and so on. Furthermore, all numbers are used exactly once and are in ascending order of numbers not yet used. In particular, I want some "closed" formula that will give me this sequence.

Suppose I have such a closed form. Then the question arises, can I construct a general "closed" formula that will produce a sequence of $n$ even numbers, followed by $m$ odd numbers, while still abiding to the acending numbers property and such that each number is also used only once?

I would really appreciate some help or insight on how to tackle this problem. Of course, other generalisations are possible (for other sets or subsets, other "rules" for the sequence) and I am also interested in those, but I would like to get a grasp on this idea first.

  • $\begingroup$ If the number of even numbers and the number of odd numbers for each block (some odd numbers, then followed by some even numbers) does not change, for the ith term, consider $i \mod (m+n)$ and $\left\lfloor\frac{i}{m+n}\right\rfloor$. $\endgroup$ – Element118 Oct 12 '17 at 12:12
  • $\begingroup$ Might be useful: oeis.org/A026200 $\endgroup$ – Matthew Conroy Oct 12 '17 at 18:49

Your Answer

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

Browse other questions tagged or ask your own question.