There should be a bounty where any prisoner who solves one of the millennium problems is granted freedom. I feel like it'd help to reduce violence and focus the purposelessness of their time into something productive to both themselves and society, would be cool to see gangs replaced by people collaborating.
What if a man solves one of the problems in secret before committing a crime? Your suggestion could then be interpreted as "permit millennium problem solvers to commit, with no legal consequence, any one crime of their choosing." That would seem like a questionable proposition to anyone not fully devoted to mathematics.
I don't know if you've ever visited an American prison, but they're a vestige of 19th-century social mores (ie - norms from an era where slavery, then Jim Crow, seemed reasonable to the average American). If you want to empower prisoners to study difficult topics like advanced mathematics, you're probably going to have to start treating them like people first.