Variation of the Josephus problem Suppose we have a circle of $2n$ people, where the first $n$ people are good guys and the people $n+1$ to $2n$ are bad guys. Can we always choose an integer $q$, such that if we execute successively every $q$-th person in the circle, the $n$ good guys will survive.
I tried to solve a few simple cases, and found the following examples:
$$
\begin{array}{c|cccc}
n & 1 & 2 & 3 & 4 \\
\hline
q & 2 & 7 & 5 & 30
\end{array}
$$
But I haven't found a general approach yet. How to tackle it?
 A: This won't necessarily produce the smallest integer $q$, but it does produce an integer that works:  Let $q=\text{lcm}(n+1,n+2,\ldots,2n)$. Such a $q$ will knock of the bad guys in reverse order, starting with person $2n$ and ending with person $n+1$.
Remark:  If you don't mind a much larger number, or don't want to bother computing a least common multiple, $q=(2n)!$ will do the trick.
A: By the way, I think that the problem makes an AWESOME brainteaser/riddle, and you might want to send this on over to the puzzling Stack page. 
So, although this isn't a formula, like Cipra's answer, I do think that it is a novel solution and greatly reduces the work need to solve the problem. I considered a setup like the following picture, I also hope that it is helpful to my explanation: 

We start with a simple yet powerful observation about how the voting out works:


*

*At every iteration, one person from, call it group two ($n+1, ..., 2n$), must be voted out. 

*Therefore, at the last iteration, we have one node left in group two. 

*And we can start counting at this point in two ways: (a) from the last node itself, or (b) from the next node i.e. the first person in the circle. 


From here we see that whatever number $q$ is, it must be either of the  form $b(n+1)$, or $b(n+1)+1$ for some $b \in \mathbb{N}$ (Why?). So, we have a very narrow list of choice to get started. 
But, we can do better; we know that for any guess $x$ of $q$, $x \not\equiv 1,2,3,...,n$ (mod $2n$). This is because we would end up at one of the nodes in group one, ($1, ..., n$).
In addition, including Cipra's answer, you can get this list down to very few possibilities. 
I am, also, still trying to come up with a better way, so I may edit this with a faster method. 
A: I wrote a script that checks every $q > n$ (mod 2$n$) until it finds a solution. Unfortunately, there doesn't appear to be a pattern (or at least one that I could find) based on the first several values.
$$
\begin{array}{c|cccc}
n & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 \\
\hline
q & 2 & 7 & 5 & 30 & 169 & 441 & 1872 & 7632 & 1740 & 93313 & 459901 & 1358657  & 2504881 & ...
\end{array}
$$
Plugging this sequence into OEIS, it seems like there has been some research into this problem, which is also known as the Turks and Christians problem (https://oeis.org/A343780).
