Results 1 to 3 of 3
Thread: some problem with sum
 12202009, 07:51 PM #1Member
 Join Date
 Dec 2009
 Posts
 1
 Rep Power
 0
 12202009, 08:15 PM #2
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 13,832
 Blog Entries
 7
 Rep Power
 21
 12202009, 10:00 PM #3Moderator
 Join Date
 Feb 2009
 Location
 New Zealand
 Posts
 4,615
 Rep Power
 12
123456 = 66 i need to print = 12+3+45+6
How would you figure out how to split the original number without a computer?
One approach might be to check longer and longer start strings:
(1) Guess that the answer is 1+... and check if you can solve the simpler problem 23456=65 (why 65?). If you find you can then you have the answer.
Otherwise (2) Guess that the answer is 12+... and check if you can solve the problem 3456=54. This will eventually find the answer.
But if it didn't you would (3) Guess that the answer is 123+... This one is interesting because it fails right away.
Perhaps you could try solving the problems by hand (ie without using a computer) using some such systematic approach. Then see if you can express the steps you take (the algorithm) in a recursive way.
Similar Threads

simple line problem / for loop problem
By helpisontheway in forum New To JavaReplies: 1Last Post: 11172009, 07:12 AM
Bookmarks