For me psilocybin is too much of an emotional experience to focus on any abstract problems. I could imagine using cannabis for problem solving — it allows for concentration and focus.
The problem is you can get to easy to focused on smaller tasks that are not really important.
I coded this while I was pretty high. https://github.com/entropie/rmp/blob/master/rmp.rb