0
\$\begingroup\$

With n people numbered 1 to n in a circle, every second one is eliminated until only one survives. For example, for n=10, the elimination order is 2 4 6 8 10 3 7 1 9, so 5 survives. The problem: Determine the survivor's number J(n).

[I claim no credit for this problem; I first saw it posed by J expert
 Eugene E. McDonnell, nor for the answer in J programming
 language that I will divulge but did not discover. Credit goes to J
 co-inventor & all round genius Roger Hui. I hope this method of presenting
 a problem is OK. If not I'll withdraw it.]
\$\endgroup\$
  • \$\begingroup\$ This is a subset of codegolf.stackexchange.com/questions/5891/…, perhaps provide a new answer there if you have something novel to share? \$\endgroup\$ – VisualMelon Mar 26 '17 at 0:40
  • \$\begingroup\$ Thanks for letting me know! I have added a new 6 byte answer and explanation to the original question.(codegolf.stackexchange.com/questions/5891/) ! \$\endgroup\$ – Richard Donovan Mar 26 '17 at 1:10

Browse other questions tagged or ask your own question.