A bit, but I tend to do directed procrastination. Go the gym, do some research on a different problem, write some emails, etc... As soon as I stop actively thinking about the problem a solution will come.
Another solution (and this works well with coding and writing) is just to start coding/writing. I'm writing an article now for a newsletter, and the top of my document is a bunch of stand alone sentences that eventually lead to a full article.
In programming, I'll often do the same thing and just start solving the problem even if I know it's not the right solution yet. Usually this leads me to a better understanding, and eventually the solution.