I don't have the math at the moment, I did the calculation in college and I no longer remember the skills to do it. But think about it: Money is taxed every time it changes hands, so when you give welfare after about 100times changing hands, 99.97 (3 sigma) is returned to the government in taxes. The conclusion is that welfare doesn't actually cost anything.
What I recall about the math is that it was a summation with a recurrence relation. I could write a program that reaches the same conclusion but I never used the advanced math enough to remember how to do it.