Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a total newbie to the world of math and was interesting in learning. I just finished my degree(non-math) and am going to study a few math books to see if it interests me to apply for something more quantitative but I want to study something interesting with interesting problems that won't bore me.

I thought about it, and thought of the type of problems that intrest me. One is predicting the future and the other is predicting the past. Here's a problem that I think would be cool. Say you have a list

calories 89, 34, 67, 43, 54, 232, 623

and someone tells you that someone had a total of "6553" calories in a day. What type of math would try to figure this out? Is it algebra? (by the way to get this question all I did was take each value above and multiple first one by 1, second one by two, etc.up to 7.)

share|cite|improve this question
I'm not sure what you're asking. What are you trying to figure out exactly? How many calories someone is likely to have in a day given a list of how many calories they've had per day recently? That sounds to me like statistics. – Alex Becker Mar 18 '11 at 3:42
Never mind - Arturo cleared it up for me, and I concur with him that this is number theory. – Alex Becker Mar 18 '11 at 4:07
up vote 7 down vote accepted

To cast the problem a little more clearly, you have a number of "weights", $w_1,\ldots,w_n$, in this case: \begin{align*} w_1 &= 89\\ w_2 &= 34\\ w_3 &= 67\\ w_4 &= 43\\ w_5 &= 54\\ w_6 &= 232\\ w_7 &= 623, \end{align*} and a "target total" $T$, in this case $T=6553$. You want to find nonnegative integers $a_1,\ldots,a_n$ such that $$a_1w_1 + \cdots + a_nw_n = T.$$

In its broadest sense, this is an example of what is called a Diophantine equation (an equation in which we require the solutions to be nonnegative integers, or more generally rational numbers). They are studied in the branch of mathematics called Number theory.

share|cite|improve this answer
thank you so much, Arturo. I'm wondering in number theory would a question like this be solvable? is it practical or abstract theory? – Lostsoul Mar 18 '11 at 4:11
@Lostsould: Although Diophantine equations, in general can be pretty hard (Fermat's Last Theorem is an example of a Diophantine equation, for instance), this particular kind of problem (a "linear diophantine equation") is generally straightforward (in a practical sense). There are well-known, good algorithms for solving them (or showing no solution exists). But even a small tweak can make the problem very hard; see for example the closely related knapsack problem ( and postage stamp problem ( – Arturo Magidin Mar 18 '11 at 4:16
@Lostsoul: Elementary number theory is both beautiful, classical, and full of interesting stuff without needing too much background. It's a great gateway to "bigger and better" things (leads to both complex analysis and to abstract algebra). Advanced techniques would require more background, but one can go pretty far regardless. – Arturo Magidin Mar 18 '11 at 13:17
@Lostsoul: There are problems that are very hard to solve practically. For example, factoring a big number is easy in principle (just try dividing all the primes up to $\sqrt{n}$ to see if it has a factor, then lather, rinse, and repeat), but for large numbers it can be so computationally expensive that you wouldn't be able to carry out to procedure before the sun burns out. Other problems admit too many possible solutions that they don't let you get much information. Not so much a limitation of number theory, but rather of what one wants to actually be able to do. – Arturo Magidin Mar 19 '11 at 1:32
Sorry I should have marked this resolved a while ago. I have been a bit busy and am just starting to venture into this project, I have done a little reading and I can't thank you enough for introducing me to this, Arturo. I have a book on the knapsack problem and will eventually look at the diophantine equation. Thank you so much Arturo(I will def be more active and bugging you all with questions as I dig into the material). – Lostsoul May 9 '11 at 22:25

For your question you need to find positive integer solutions to $89a +34b +67c +43d+ 54d +232d+ 623e=6553$, $\{a,...,e\}$ are the number of items you eat of each to get 6553 calories. Problems like this where you need to find integer solutions are called linear Diophantine equations. But you can treat them as puzzles and try to use some hit and trial methods/computations. Sometimes, though not always, Wolfram alpha might help.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.