This can actually be formulated as an interesting (constrainted) optimization problem.
Given
* an amount of calories
* a distribution of macronutritions (protein,fat,simple carbs, complex carbs)
* a certain variablility (at least 20(?) different foods)
do minimize:
- Cost
Interesting problem.
A more thorough database with micronutritions would even yield a healthier result
Edit: Look like it's not new: http://en.wikipedia.org/wiki/Stigler_diet