# 5th Grade Math Question



## schielrn (Feb 6, 2013)

Ok here is the scenario:

A father takes his son to work with him to the M&M plant. While there, the son notices a special section where there are many different size bags of M&M's. The son asks his dad if he can take back some of those M&M's to his class. The father says, you sure can, but with one condition, you can answer me the following question:



> We have 150 bags of M&M's here and they are all numbered 1 to 150. Each bag has the number of M&M's in it equal to the number on the bag. If I tell you that you can take any bag that is a multiple of 3, 5 or 7, how many M&M's will you have to take to your class?



Now I can solve it using an array formula:


```
=SUM(IF((MOD(ROW(1:150),3)=0)+(MOD(ROW(1:150),5)=0)+(MOD(ROW(1:150),7)=0),ROW(1:150)))
```
</SPAN>

, but am I missing a pattern somewhere to not have to calculate using brute force? Basically they printed out a paper with 1 to 150 and then he went through each number and crossed out any that were not multiples and added up all the uncrossed numbers, but not sure what that is doing for the kid? Usually these questions have some type of logic to them like last week's problem was what is the next number in the sequence?

1
3
6
10
15

And what comes after 55?

Hope that makes sense and maybe there is no pattern, but just seems odd and won't know until the teacher gives them the answer at the end of the week.


----------



## xenou (Feb 6, 2013)

Dunno.  Maybe its just for practice finding common multiples.

I'd do the crossing out like this (maybe):


Start with three lists - multiples of 3, of 5, and of 7, each listed out up to 150 (max).
Beginning with the list of multiples of 7 and cross out common multiples of 7 and 3 (multiples of 21) and common multiples of 7 and 5 (multiples of 35).
Next with the list of multiples of 3 cross out common multiples of 3 and 5 (multiples of 15)
Done!


Note:
Actually to try to do this with less adding up at the end (!) assuming you're pen and paper'ing it:

Sum the 3s, 5s, and 7s
Subtract the common multiples of 7 and 3 and the common multiples of 7 and 5, but don't double count 105 (ugly - it's a common multiple of 15 and 21)
Subtract the common multiples of 3 and 5

Hence:

+50*(3+150)/2      -- 3s
+30*(5+150)/2      -- 5s
+21*(7+147)/2      -- 7s
-7*(21+147)/2      -- less common multiples of 3 and 7
-4*(35+140)/2      -- less common multiples of 5 and 7
-10*(15+150)/2      -- less common multiples of 3 and 5
+105                -- addback one double-counted number


Result is 6109


----------



## pgc01 (Feb 6, 2013)

Hi</SPAN>

If I remember high school correctly, you want the number cardinal of the union of the sets. If the sets are disjoint it's just adding the number of elements of the sets. If they are not disjoint, the general rule for the number cardinal of the union of the sets was</SPAN>

add the number cardinal of all the sets</SPAN>
subtract the number cardinal of all the intersections of sets 2 by 2</SPAN>
add the number cardinal of all the intersections of sets 3 by 3</SPAN>
etc.</SPAN>

In this case you want:</SPAN>

Add all the multiples of 3, 5 and 7</SPAN>
Subtract all the multiples 3*5, 3*7 and 5*7</SPAN>
Add all the multiples 3*5*7</SPAN>

These all all arithmetic progressions, you can write it into an excel formula:</SPAN>

=SUM(({3,5,7,15,21,35,105}+FLOOR(150,{3,5,7,15,21,35,105}))/2*INT(150/{3,5,7,15,21,35,105})*{1,1,1,-1,-1,-1,1})</SPAN>

which compared to your formula</SPAN>

=SUM(IF((MOD(ROW(1:150),3)=0)+(MOD(ROW(1:150),5)=0)+(MOD(ROW(1:150),7)=0),ROW(1:150)))</SPAN>

is a bit bigger.</SPAN>

This new formula is, however more efficient as it is not a brute force method. If instead of up to 150 you want to do it up to 1500 or 15000 then this new formula will take the same time whereas the formula you posted will take much more time as it loops through all the values.</SPAN>

HTH


----------



## pgc01 (Feb 6, 2013)

P. S.

Besides being a more efficient result it's also, IMO, a more interesting interesting approach. It does not use brute force, it tells the pupil that you can solve a problem with was was teached in the class, it uses set theory and series, which may be the objective of the teacher.


----------



## HalfAce (Feb 6, 2013)

Man... 5th grade math seems a lot harder than it was 45 years ago.


----------



## pgc01 (Feb 7, 2013)

You may be right and I misinterpreted the question.I read "5th Grade Math Question" as "high school problem". If schielrn means literally 5th grade then the method he and xenou wrote (writing the numbers 1-150 and crossing out the multiples of 3, 5 and 7), may be the solution. Or maybe doing that and use it to learn the set theory part.



HalfAce said:


> Man... 5th grade math seems a lot harder than it was 45 years ago.


----------



## schielrn (Feb 7, 2013)

Very interesting Alex.  That seems like a logical approach to it as opposed to brute force of listing everything out.

PGC, I like that formula and it is basically putting xenou's thinking into a formula that is less resource intensive.

Thanks for the response everyone and with this being a 5th grade problem, I assume it is just recognizing what numbers below 150 are multiples of 3, 5 and 7.


----------



## schielrn (Feb 8, 2013)

Here was the teacher's solution:

Sum of the multiples of 3 = 3(50*51/2) = 3825
Sum of the multiples of 5 = 5(30*31/2) = 2325
Sum of the multiples of 7 = 7(21*22/2) = 1617

Subtract out multiples of 3 and 5 = 3*5 = 15 -- 150/15 = 10 -- 15(10*11/2) = 825
Subtract out multiples of 5 and 7 = 5*7 = 35 -- 150/35 = 4 -- 35(4*5/2) = 350
Subtract out multiples of 3 and 7 = 3*7 = 21 -- 150/21 = 7 -- 21(7*8/2) = 588

Then lastly add back any multiples of 3, 5 and 7 = 3*5*7 = 105 -- 150/105 = 1 -- 105(1*2/2) = 105

So it is almost identical to Xenou's answer, but just some different orders of operations because it comes to the same results for each individual piece.

I just don't know how a 5th grader is expected to understand that?  Thanks for looking everyone.


----------

