I have one doubt in josephus problem.

check the recurrence for general case on wikipedia Josephus
Problem<http://en.wikipedia.org/wiki/Josephus_problem#The_general_case>


*f(n,k) = (f(n-1,k) + k) mod n with f(1,k) = 1 *

when i take n = 2 and k = 3,answer i am expecting was 2 but answer is
coming out to be 1.

Am i doing something wrong or k should be greater than n always ?

Thanks & Regards,
*Satyajit Bhadange
Software Programmer*

*Problems & Solutions* <http://satyajit-algorithms.blogspot.com/>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to