I believe the question is about how much grain to use for a given recipe batch size, not about mash thickness.
The fun begins with a value called PPG - Points per Pound per Gallon. Each type of fermentable (grains, sugars) has a PPG value; this corresponds to its theoretical maximum sugar yield. It's the number of gravity points that a pound of the fermentable will yield to a gallon of water.
A typical base malt has 37 PPG. That means a pound of this malt, when mashed with one gallon of water, and we get every molecule of sugar possible, the resulting wort will have a gravity of 1.037.
Of course, we never get
all the sugar. So we have to multiply the theoretical gravity by our predicted mash efficiency - let's say 75% - so the 1.037 becomes 1.028.
The equation for this is:
Pre-Boil Gravity Pts = (PPG x lb) / Pre-Boil Gal. x Mash Efficiency
Each fermentable has a different PPG and weight, so the equation must be done separately for each ingredient. The sum of all these gravity point values equals the predicted pre-boil SG.
You can then predict the OG by including the pre- and post-boil wort volumes:
Predicted OG = Pre-Boil SG x Pre-Boil Gal. / Ending Kettle Gal.
It's far easier to do this in software, which is what all the popular tools do - or build your own spreadsheet to handle it. Here's a list of common PPG values:
http://www.brewersfriend.com/fermentables/