Pregunta de entrevista de Bloomberg

Given two integers n and p, continually iterate through 1...n and remove the pth integer, until there is only one integer left