What you call "solitary confinement" is standard procedure before a trial. This is not considered torture by either the UN or Amnesty International. As soon as the trial is over he'll be transfered to a regular prison and restrictions will be relaxed. He may then study mathematics if he feel like it.
That entirely depends on how long that situation lasts. Whether it's a few days or a few months.
If the investigation was ongoing they could deny him based on risk of tampering with evidence ("kollusionsfara"), I guess. A bit farfetched, but possible. The investigation is finished, is he still being denied access to a calculator?
EDIT: OK, after looking into this a bit I'm guessing BrB 24 kap 5a makes it legal.
It's not about hacking, per se. It's about not using computing devices, and it's about convenience for the legal system. If they allow a graphing calculator, should they allow a PDP? Is internet access the limiting factor? Can he send code on a USB key to his teacher?
For a non-technical person to decide where that line is would be very difficult (as a technical person, I couldn't tell you offhand where it stops). 'No computing devices' is easy, and not unreasonable.
Of course, anyone on HN will complain that the legal system needs to be aware of technology. If we get into that argument, every public representative will need to be a painter, race car driver, astronaut and programmer. Because they don't really understand <x> well enough to legislate about it.