The original message from Deja-News follows:
-- -The original message from Deja-News follows:
- -
-Subject: Repeating Code Possibilities +-A final note about this problem: if a code has an effective repetition that -is some integer division of l, it's still of length l. E.g: the code -10101010... is still considered the 4-bits code 1010 (or 0101). +A final note about this problem: if a code has an effective +repetition that is some integer division of l, it's still of length +l. E.g: the code 10101010... is still considered the 4-bits code +1010 (or 0101). The continuation which includes the answer can be +found a couple of pages below.+Subject: Repeating Code Possibilities From: Shlomi Fish <shlomi@medusa.cortext.co.il> Date: 1996/06/10 Message-ID: <31BC1616.34C6@medusa.cortext.co.il> Newsgroups: rec.puzzles -[More Headers] - +[More Headers] + I've got a question in combinatorics. Let's suppose that there is a transmitor that trasmits a code repeatedly. Once it reaches the end of @@ -37,43 +44,108 @@ digits and is of length l, what is the number of different codes possible? - Shlomi Fish -+ Shlomi Fish +
Eventually, I had an idea. Like I said, some codes have an +effective repetition that is some integer division of the given +code-length. Normal codes have l permutations. For example the code +'1100' can also be written as '0110', '0011' and '1001'. However, +codes of one of l's dividers have less permutations. '1010' only +has two permutations: '1010' and '0101'.
-The continuation which includes the answer can be found a couple of pages -below. +So, I posted the following message to rec.puzzles a couple of +monthes after my original posting. The solution presented there is +not intirely correct, so read my notes below.
-- -Eventually, I had an idea. Like I said, some codes have an effective -repetition that is some integer division of the given code-length. Normal -codes have l permutations. For example the code '1100' can also be -written as '0110', '0011' and '1001'. However, codes of one of l's dividers -have less permutations. '1010' only has two permutations: '1010' and '0101'.
- -So, I posted the following message to rec.puzzles a couple of monthes after -my original posting. The solution presented there is not intirely correct, -so read my notes below. -
- -
-Subject: Repeating Code Riddle (+ Spoiler) +-Well, I didn't take in mind that a number can indirectly receive codes from -a divider by two or more other dividers (like 12 that gets codes from 2 -through both 4 and 6). Thus, O(n) the function that denotes the number of -"original" codes of n should be recursive and defined as following:+Subject: Repeating Code Riddle (+ Spoiler) From: ffish@euronet.co.il (Shlomi Fish) Date: 1996/08/16 Message-ID: <4v1nm5$583@shelly.inter.net.il> Newsgroups: rec.puzzles -[More Headers] - +[More Headers] + I posted this puzzle here some time ago because I didn't know the answer. Yet, I managed to figure it out by myself after all so here's @@ -140,7 +212,7 @@ O(n) = [ T(n) - (T(q1) + T(q2) + T(q3) ... + T(qt) ) ] / n ( O(1) = 2) -O(n) denotes the number of codes which are "original" to n and weren't +O(n) denotes the number of codes which are "original" to n and weren't inherited from any smaller number. Now if q1, q2...qt will again stand for the dividers of n then the @@ -150,27 +222,27 @@ Shlomi Fish -+
+Well, I didn't take in mind that a number can indirectly receive +codes from a divider by two or more other dividers (like 12 that +gets codes from 2 through both 4 and 6). Thus, O(n) the function +that denotes the number of "original" codes of n should be +recursive and defined as following: +
O(1) = 2
+O(n) = T(n)/n for every prime number n
+O(n) = [ T(n) - (O(q1)*q1 + O(q2)*q2 + .. O(qt)*qt ) ] / n
+for all other numbers
+
Otherwise the solution is fine. You can view a C program that +calculates the number of such codes for all numbers up to 24 here.
-+