Skip to content

Instantly share code, notes, and snippets.

@eckorog2005
Created January 17, 2013 22:32
Show Gist options
  • Select an option

  • Save eckorog2005/4560474 to your computer and use it in GitHub Desktop.

Select an option

Save eckorog2005/4560474 to your computer and use it in GitHub Desktop.
//simple Josephus function
public static int jP(int n, int k){
if(n == 1){
return 1;
}else{
return ((jP(n - 1, k) + k - 1) % n) + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment