The main recollection I have is that the main protagonist is an engineered being, mostly human, but who can enter a state that lasts a few weeks, in which the protagonist can change its body, even its sex.
The protagonist can use some means to calculate future events, but the way he does that changes when he changes his body. Sometimes the calculation is more mathematical, others it is more holistic. I also seem to recall the at first he is not exactly a prisoner, but is locked out and eventually escapes.