Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

sequence 1 2 3 4 5 6=12

Does anyone know how to write a formula for "list possibilities of sequencing 1, 2, 3, 4, 5 and 6 to equal 12. any combination, any repetition, any omission"?


Rob.

MacBook, OS X Mountain Lion (10.8.2), 4 GB ram iWeb '09 3.0.4

Posted on Feb 22, 2013 8:06 AM

Reply
20 replies

Feb 22, 2013 10:57 AM in response to indigorob

indigorob wrote:


I want to make a checklist of possibilities of interval permutations equalling one octave for music. My description is quite concise. 1+1+1+1+1+1+1+1+1+1+1+1 all the way to 6+6=12. It is simple to calculate compared to apples and oranges type lists.

Rob

Rob,


I apologize if it appeared that I was trying to torture you, but I couldn't imagine the purpose for what would be a very difificult task in a spreadsheet. If you think it's simple, I think your best course would be to describe your approach to the calculation and see if someone can come up with a script to do that calculation.


Jerry

Feb 22, 2013 1:41 PM in response to indigorob

According to my calculation, your list would be 0.88 miles long, at 5 lines to the inch. It will take several tables to do that in Numbers because of the limit on the number of rows in a table. List one possible combination in each row and sum each row in an auxiliary column. Then sort the results by the auxiliary columns and copy the rows where the answer is 12.


Jerry


😁

Feb 22, 2013 2:06 PM in response to indigorob

You can yell all you like (and we will simply ignore you). We heard your request but it is not a simple one to solve. I believe the end result will be such a long "checklist" that it will be completely useless, thus making all the work we would put into it useless. You disagree but I, personally, am not going to spend hours developing an algorithm in Applescript that will solve this problem when I already know the result will be useless. So I will bow out of this discussion after this post.


There are recursion algorithms for combining items from a list of numbers so they sum to a total. I do not know of any that care about the order in which the numbers appear in the result, which is something you desire. The algorithms I am talking about increase exponentially in calculation by the number of items on the list. If you were not concerned about the order, the algorithm would require a list of the following numbers:


1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,5,5,6,6


http://stackoverflow.com/questions/4632322/finding-all-possible-combinations-of- numbers-to-reach-a-given-sum


My recommendation is this: learn how these algorithms work. Learn Applescript or another programming language. Write the code to do it. Buy a number of reams of paper and a lot of ink. Have at it.

sequence 1 2 3 4 5 6=12

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.