Check out:
http://www.aamc.org/advocacy/library/gme/gme0001.htm which as some links on this issue including this nice brochure:
http://www.aamc.org/advocacy/library/gme/dgmebroc.pdf. Like most PDF files, it will only take about 5 or 6 tries to download. Keep trying though, it is worth it.
In summary, there are 2 types of funding, Direct and Indirect. These amounts vary based on several factors such as the number of Medicare patients, the average stay of these patients, a "hospital specific amount", the position of the sun, and the temperature in Toledo, Ohio (ok, I made the last 2 up). When you match into a field, you are 'locked' into how many years of full Direct funding the government will give your program. For example, if you match into IM you have 3 years of full Direct funding (they count you 1.0 when they do the math). Once you use up those 3 years, since you are obviously completely useless, you count as half a resident. I'm not kidding, when they do the math you are counted as 0.5.
This is only true for the Direct funding; for the Indirect funding you count as a whole person for as many years as it takes.
The brochure above shows some nice examples of the math. It also mentions that for most hospitals, the Indirect funding "far exceeds" the Direct. It goes on to say, So as a percentage of the hospitals total Medicare medical education payment, the financial impact of a resident beyond the initial residency period may be small.
Hope this helps.