Tell a story of the Unabomber sitting in prison working on proving the Riemann Hypothesis. Not too unrealistic: his Ph.D. was in analysis. The story is, this was always his endgame: he knew he might be spending the last few decades of his life in prison, and he knew he could do something productive and satisfying with his time there.
Tell a story of someone else, not yet in prison but considering embarking on a project very likely to result in a long prison sentence, studying up on math beforehand -- maybe the Clay Millennium problems -- to prepare for eventually doing time.
It would be politically uneasy if a prisoner, especially an especially bad one such as the Unabomber, were to achieve positive renown for doing something like proving the Riemann Hypothesis while imprisoned. Therefore, we expect prisons to be set up to make such work difficult: what are those things? Ends up being a roundabout restriction on speech. Study whether such roundabout restrictions on speech also occur outside of prisons.
A vindictive society wants to make sure people in prison suffer, not be able to do anything pleasant, even if thinking and writing about math should be pleasant. Should vindictive society get its way?