You can download a book (pdf file), called Marijuana Mass Production Made Easy. It is a old school book, however I remember seeing a section on how to mix your own raw nutrients, the way it is broken down is simple, and it is truly astonishing how cheap this method is.
Also a good idea from the book is to add sea kelp to your mixture to increase flavor of the flowers. Gives a bit of an organic twist on to the synthetic nutrients.
Here is a formula for GROW (G);
"The Grow formula listed below will make approx 80 gallons at 700 PPM
1G). CaNO3 224 grams Calcium Nitrate
2G). K2SO4 28 grams Potassium Sulphate
3G). KNO3 86 grams Potassium Nitrate
4G). KH2PO4 46 grams Mono Potassium Phosphate
5G). MGSO4 132 grams Magnesium Sulphate
6G). Trace 24 grams Trace Elements"
Here is the formula for Bloom (B);
"The Bud formula listed below will make approx 80 gallons at 900 PPM
1B). CaNO3 315 grams Calcium Nitrate
2B). K2SO4 128 grams Potassium Sulphate
3B). KH2PO4 104 grams Mono Potassium Phosphate
4B). MGSO4 213 grams Magnesium Sulphate
5B). Trace 34 grams Trace Elements"
There is also some information on how to mix this.
"Once all the ingredients are ready you must mix them in the correct order. lf you change the order of the mix the nutrients will bond together and the food will become useless. Start by filling a rubber garbage can with HOT WATER. This can be done with a garden hose attached to any household tap. You will also need a large stir stick, approximately 4ft in length x 2 inches x 3 inches. Each ingredient should be mixed very well for 1 minute or until the solution is clear in appearance. The ingredients are listed in sequence below."
Now of course, you are going to have to scale this down for your own use (or up!), but this is a good formula, and will work well as a reference point.
Hope it helps, peace.