Consider the following variation of the famous Josephus problem:
The numbers 1 through $n$ are lined up. Each round, every $k$th number is eliminated, starting from the first one (so the numbers in positions $1$, $k+1$, $2k+1$ get eliminated, and the positions of the remaining numbers change after each elimination). Eventually, after many rounds, there will be only one number left. Which one will it be?
My progress so far: For the $k=2$ case, the answer is simply the max power of 2 in $[1, n]$. I also got the recursion $f(n)=m+\lceil \frac{m}{k-1}\rceil$, where $m=f(n-1-\lfloor \frac{n-1}{k}\rfloor)$ (though I may have screwed up somewhere here). However, I was wondering if there is a closed form solution to this variation of the Josephus problem.
This is a nice case study in doing experiments and using tools. I'll use the notation $f_k(n)$ to denote the value of $f(n)$ when using a particular $k$.
I think this is a provable formula, and indeed the form of the recursions does seem very closely related to the original definition. Even more importantly, it's far easier to prove (or disprove) a specific formula than it is to try to guess or justify an answer out of the blue.
Morals of the story: always do some examples! Look for patterns! Use existing tools like OEIS!