in how many ways can you represent the number 123456789 using only 1's and 2's eg: 7 can be represented in 4 ways as: 1+1+1+1+1+1+1 2+1+1+1+1+1 2+2+1+1+1 2+2+2+1
Conceptually, I recommend thinking about the two extreme cases: All 1s added together, and all 2s added together. All other ways are combinations of these two.
Its answer is 61728395 it dont know it come
Well in the extreme case you know that 123456789 = 2x + 1 where x is the maximum number of 2's you can have and still be less than 123456789
so solve that for x.
If you quickly run through 1-10, you may see a pattern forming also.
great polpak
Well looking at what you listed there you can see that you have the sum of some number of 2's and some number of 1's. You know that you cannot have all 2's since it's an odd number. So on the extreme end you'll have a whole lot of 2's and one 1.
Join our real-time social learning platform and learn together with your friends!