Jump to content

Josephus problem: Difference between revisions

m
J: actually that was negation, not subtraction - so let's go a bit further in the classic notation direction
m (J: Add spaces around the subtraction to help mislead eyes slightly less when they have been [mis-]trained by some OO syntax)
m (J: actually that was negation, not subtraction - so let's go a bit further in the classic notation direction)
Line 1,031:
=== Explicit version 2 ===
<lang J>
Josephus2 =: 4 : '(| x&+)/i. - >:1+y' NB. this is a direct translation of the algo from C code above.
 
3 Josephus2 41
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.