The formula behind it is rather simple and I could probably make a calculator that would generate results given the various inputs (R, SR, grail, etc). Maybe I'll do it when I'm bored, since I'm always interested in min/maxing with limited resources. Gold can be freely converted into R weapons, so I could compute that cost as well.