Let me begin by giving you an idea of what kind of chart I'm trying to make. This would be ideal:

54217

I've spent hours trying to solve this problem without any luck. I'm pretty sure that it's...