Friday, 6 June 2025

Binomial Number System

I made a post titled Encoding Secret Numbers only recently on the 8th of May 2025 in which I looked at how the Heinz number and Gray Code could be used to encrypt a number. An article I read today suggested another encryption method that is more arcane than the two previously mentioned. The article states that every non-negative integer n can be written as:(a1)+(b2)+(c3) where ab<cThe article goes on to say that:

You can find a, b and c much as you would find the representation in many other number systems: first find the largest possible c, then the largest possible b for what’s left, and then the remainder is a
In order to find c, we start with the observation that the binomial coefficient C(k, 3) is less than k3/6 and so c is less than the cube root of 6n. We can use this as an initial lower bound on c then search incrementally. If we wanted to be more efficient, we could do some sort of binary search.

Figure 1 shows the Python code to find a, b and c:


Figure 1: permalink

In the article the term binomial number system is used to describe this approach. Applying the code to the number associated with my diurnal age today (27823) we find that a=12, b=14 and c=56 so that:27823=(121)+(142)+(563)This encrypted version of 27823 could be represented as 12. 14. 56 with the dots being added to prevent possible ambiguity although commas or dashes or whatever could be used as well. The encrypted number has the same number of digits as the number being encrypted.

Unless someone knew about this "binomial number system" it would be impossible to guess what number was being encrypted. Once the binomial "key" is applied however, we find that:12.14.5612+91+27720=27823What about the number 1? Well, in that case, we a=b=0 and c=3 because:1=(01)+(02)+(33)0.0.3What about the number 2. In this case we have a=0, b=2 and c=3 so that:2=(01)+(22)+(33)0.2.3Of course for the number 3 we have a=1, b=2 and c=3 so that:3=(11)+(22)+(33)1.2.3Interestingly, the final comment that the author of the referenced article makes is that "you could use any number of binomial terms, not just three". One binomial term C(a, 1) just corresponds to the positive integers since:(a1)=aTwo binomial terms work as well of course. For example:(21)+(52)=2+10=12Notice that this representation of 12 (and any other number) is unique because even though:(61)+(43)=6+6=12this representation contravenes the rule that ab since a=6 and b=4. All very interesting.

No comments:

Post a Comment