Showing posts with label letters. Show all posts
Showing posts with label letters. Show all posts

Saturday, 20 December 2025

Cryptographic Application of Building Block Numbers

Given that any number up to 243373 can be represented using only the building blocks 1, 2, 4, 11, 25, 64, 171, 569, 3406 and 27697, I thought that capital letters could be used to represent these building block numbers: A for 1, B or 2, C for 4, D for 11, E for 25, F for 64, G for 171, H for 569, I for 3406 and J for 27697. 

With the input of a given natural number, I asked Gemini to output the building block representations using these letters, retaining brackets and any + signs but omitting any multiplication signs (as in algebra). Thus 12 = (1 + 2) * 4 would become (A + B) C. I'm was thinking in terms of cryptography where the number will be disguised using the alphabet cyphers just described and only be dicipherable using the key (A=1, B=2 and C=4 etc.). The program only needs to deal with building blocks up to 27697. 


Infographic generated by Nano Bananas using this blog's content.

Gemini duly came up with the Python program and Figure 1 shows the output:

Figure 1:
see Python code below

The program times out in SageMathCell so I've included the Python code below for reference. If making practical use of this form of encryption, one of these representations would be chosen at random and used to replace the decimal number.

*******************************
PYTHON CODE
(courtesy of Gemini)

import itertools

def solve_oeis_crypto_cipher(target):
    """
    Finds algebraic representations of 'target' using OEIS A086424 terms.
    Outputs the result using Letter Ciphers (A=1, B=2, ...).
    
    Rules:
    - A=1, B=2, C=4, D=11, E=25, F=64, G=171, H=569, I=3406, J=27697
    - Multiplication (*) is implicit (omitted). e.g., A*B -> AB
    - Addition (+) is retained.
    - Brackets included only when necessary.
    """
    
    # 1. Define the Cipher Mapping
    # We only go up to J (27697) as requested
    term_map = {
        1: 'A', 2: 'B', 4: 'C', 11: 'D', 25: 'E', 
        64: 'F', 171: 'G', 569: 'H', 3406: 'I', 27697: 'J'
    }
    
    full_sequence = sorted(term_map.keys())
    
    # Filter terms to only those small enough to be useful
    terms = [x for x in full_sequence if x <= target]
    n = len(terms)
    
    # DP State: dp[mask][value] = set of Canonical Tuples
    # Tuple Structure: ('TYPE', (operands...))
    dp = [{} for _ in range(1 << n)]
    
    # Helper to generate a consistent sort key for uniqueness
    def get_sort_key(item):
        return str(item)

    # Initialize with single terms
    for i in range(n):
        val = terms[i]
        mask = (1 << i)
        dp[mask][val] = { ('NUM', val) }

    # Iterate through mask sizes
    for r in range(2, n + 1):
        for indices in itertools.combinations(range(n), r):
            mask = sum(1 << i for i in indices)
            set_bits = [b for b in range(n) if (mask >> b) & 1]
            
            # Split mask
            for k in range(1, r // 2 + 1):
                for sub_indices in itertools.combinations(set_bits, k):
                    s = sum(1 << i for i in sub_indices)
                    comp = mask - s # SageMath safe subtraction
                    
                    if k * 2 == r and s > comp: continue
                    if not dp[s] or not dp[comp]: continue
                    
                    # Combine results from submasks
                    for v1, exprs1 in dp[s].items():
                        for v2, exprs2 in dp[comp].items():
                            
                            for e1 in exprs1:
                                for e2 in exprs2:
                                    
                                    # --- ADDITION ---
                                    res_sum = v1 + v2
                                    if res_sum <= target:
                                        ops = []
                                        # Flatten left
                                        if e1[0] == 'SUM': ops.extend(e1[1])
                                        else: ops.append(e1)
                                        # Flatten right
                                        if e2[0] == 'SUM': ops.extend(e2[1])
                                        else: ops.append(e2)
                                        
                                        ops.sort(key=get_sort_key)
                                        new_struct = ('SUM', tuple(ops))
                                        
                                        if res_sum not in dp[mask]: dp[mask][res_sum] = set()
                                        dp[mask][res_sum].add(new_struct)
                                    
                                    # --- MULTIPLICATION ---
                                    # Skip *1 (Identity)
                                    if v1 == 1 or v2 == 1: continue
                                    
                                    res_prod = v1 * v2
                                    if res_prod <= target:
                                        ops = []
                                        # Flatten left
                                        if e1[0] == 'PROD': ops.extend(e1[1])
                                        else: ops.append(e1)
                                        # Flatten right
                                        if e2[0] == 'PROD': ops.extend(e2[1])
                                        else: ops.append(e2)
                                        
                                        ops.sort(key=get_sort_key)
                                        new_struct = ('PROD', tuple(ops))
                                        
                                        if res_prod not in dp[mask]: dp[mask][res_prod] = set()
                                        dp[mask][res_prod].add(new_struct)

    # --- Formatting Function for Cipher Output ---
    def format_cipher(expr):
        etype, content = expr
        
        if etype == 'NUM':
            # Return the Cipher Letter
            return term_map[content]
            
        elif etype == 'SUM':
            # Join with "+"
            return "+".join(format_cipher(c) for c in content)
            
        elif etype == 'PROD':
            parts = []
            for c in content:
                s = format_cipher(c)
                # Add brackets ONLY if the child is a SUM
                if c[0] == 'SUM':
                    s = f"({s})"
                parts.append(s)
            # Join with empty string (Implicit multiplication)
            return "".join(parts)

    # --- Collect and Print Solutions ---
    solutions = []
    # Check every mask for the target value
    for m in range(1 << n):
        if target in dp[m]:
            for struct in dp[m][target]:
                solutions.append(format_cipher(struct))
    
    if not solutions:
        return [f"No solution found for {target}."]
    
    # Sort by length for readability
    return sorted(list(set(solutions)), key=len)

# --- User Input Section ---
target_integer = 28020

# Run
results = solve_oeis_crypto_cipher(target_integer)

# Output
print(f"Cipher Results for {target_integer}:")
print(f"Key: A=1, B=2, C=4, D=11, E=25, F=64, G=171, H=569, I=3406, J=27697")
print("-" * 60)
for res in results:
    print(res)

Sunday, 20 July 2025

Hexadecimal Words

Certain hexadecimal numbers contain only letters between A (10) and F (16) and so can form English words. The commonly accepted words are:

a, aba, abaca, abed, accede, acceded, ace, aced, ad, add, added, baa, baad, babe, bad, bade, baff, baffed, be, bead, beaded, bed, bedded, bee, beef, beefed, cab, cad, cade, cafe, cede, ceded, cee, dab, dabbed, dace, dad, daff, dead, deaf, decade, dee, deed, deeded, deface, defaced, ebb, ebbed, efface, effaced, fa, facade, face, faced, fad, fade, faded, fed, fee, feed

These hexadecimal "words" with their decimal equivalents are shown below (arranged alphabetically):

10 --> a
2746 --> aba
703178 --> abaca
44013 --> abed
11325150 --> accede
181202413 --> acceded
2766 --> ace
44269 --> aced
173 --> ad
2781 --> add
712173 --> added
2986 --> baa
47789 --> baad
47806 --> babe
2989 --> bad
47838 --> bade
47871 --> baff
12255213 --> baffed
190 --> be
48813 --> bead
12496365 --> beaded
3053 --> bed
12508653 --> bedded
3054 --> bee
48879 --> beef
12513261 --> beefed
3243 --> cab
3245 --> cad
51934 --> cade
51966 --> cafe
52958 --> cede
847341 --> ceded
3310 --> cee
3499 --> dab
14334957 --> dabbed
56014 --> dace
3501 --> dad
56063 --> daff
57005 --> dead
57007 --> deaf
14600926 --> decade
3566 --> dee
57069 --> deed
14609901 --> deeded
14613198 --> deface
233811181 --> defaced
3771 --> ebb
965613 --> ebbed
15727310 --> efface
251636973 --> effaced
250 --> fa
16435934 --> facade
64206 --> face
1027309 --> faced
4013 --> fad
64222 --> fade
1027565 --> faded
4077 --> fed
4078 --> fee
65261 --> feed

The decimal numbers in ascending order are:

10, 173, 190, 250, 2746, 2766, 2781, 2986, 2989, 3053, 3054, 3243, 3245, 3310, 3499, 3501, 3566, 3771, 4013, 4077, 4078, 44013, 44269, 47789, 47806, 47838, 47871, 48813, 48879, 51934, 51966, 52958, 56014, 56063, 57005, 57007, 57069, 64206, 64222, 65261, 703178, 712173, 847341, 965613, 1027309, 1027565, 11325150, 12255213, 12496365, 12508653, 12513261, 14334957, 14600926, 14609901, 14613198, 15727310, 16435934, 181202413, 233811181, 251636973

OEIS A132676 shows these same numbers. 

If we are only interested in decimal numbers whose hexadecimal equivalents contain only letters and no digits from 0 to 9 then these are listed in OEIS A228774. Up to 40000, there are 258 of them and they can be generated via this permalink.

10, 11, 12, 13, 14, 15, 170, 171, 172, 173, 174, 175, 186, 187, 188, 189, 190, 191, 202, 203, 204, 205, 206, 207, 218, 219, 220, 221, 222, 223, 234, 235, 236, 237, 238, 239, 250, 251, 252, 253, 254, 255, 2730, 2731, 2732, 2733, 2734, 2735, 2746, 2747, 2748, 2749, 2750, 2751, 2762, 2763, 2764, 2765, 2766, 2767, 2778, 2779, 2780, 2781, 2782, 2783, 2794, 2795, 2796, 2797, 2798, 2799, 2810, 2811, 2812, 2813, 2814, 2815, 2986, 2987, 2988, 2989, 2990, 2991, 3002, 3003, 3004, 3005, 3006, 3007, 3018, 3019, 3020, 3021, 3022, 3023, 3034, 3035, 3036, 3037, 3038, 3039, 3050, 3051, 3052, 3053, 3054, 3055, 3066, 3067, 3068, 3069, 3070, 3071, 3242, 3243, 3244, 3245, 3246, 3247, 3258, 3259, 3260, 3261, 3262, 3263, 3274, 3275, 3276, 3277, 3278, 3279, 3290, 3291, 3292, 3293, 3294, 3295, 3306, 3307, 3308, 3309, 3310, 3311, 3322, 3323, 3324, 3325, 3326, 3327, 3498, 3499, 3500, 3501, 3502, 3503, 3514, 3515, 3516, 3517, 3518, 3519, 3530, 3531, 3532, 3533, 3534, 3535, 3546, 3547, 3548, 3549, 3550, 3551, 3562, 3563, 3564, 3565, 3566, 3567, 3578, 3579, 3580, 3581, 3582, 3583, 3754, 3755, 3756, 3757, 3758, 3759, 3770, 3771, 3772, 3773, 3774, 3775, 3786, 3787, 3788, 3789, 3790, 3791, 3802, 3803, 3804, 3805, 3806, 3807, 3818, 3819, 3820, 3821, 3822, 3823, 3834, 3835, 3836, 3837, 3838, 3839, 4010, 4011, 4012, 4013, 4014, 4015, 4026, 4027, 4028, 4029, 4030, 4031, 4042, 4043, 4044, 4045, 4046, 4047, 4058, 4059, 4060, 4061, 4062, 4063, 4074, 4075, 4076, 4077, 4078, 4079, 4090, 4091, 4092, 4093, 4094, 4095

The final number (4095) in the list above is equivalent to "f f f" in hexadecimal. All the English words listed at the start of this post will be included in this list of course. Up to one million, there are 8034 such decimal numbers with letter-only hexadecimal equivalents and there are significant gaps between groups of numbers. See Figure 1.


Figure 1: permalink
On vertical scale 1.0 = One Million

Monday, 31 July 2023

Iban Numbers

I was struggling to find something of significance (in my mind) about the number associated with my diurnal age today which is 27147. However, after much fruitless investigation and experimentation, I noticed something at the very bottom of the Numbers Aplenty entry for the number. It read as follows:

The spelling of 27147 in words is "twenty-seven thousand, one hundred forty-seven", and thus it is an iban number.

Hmmm. What on Earth is an iban number I thought. Well a definition was only a hyperlink away:

A number is called iban if its name (in English) does not contain the letter "i". Assuming that the name of every power of 10 greater than \(10^5\)  ends in "-illion" (like million, billion, trillion, etc.), then the iban numbers are finite. Counting 0 (zero) there are 30276 of them, the largest being 777777. Iban numbers belong to the same family as aban numbers, eban numbers, oban numbers, and uban numbers. 

These numbers constitute OEIS A089589:


 A089589

Iban numbers (the letter i is banned from the English name of the number).


The initial members are:

0, 1, 2, 3, 4, 7, 10, 11, 12, 14, 17, 20, 21, 22, 23, 24, 27, 40, 41, 42, 43, 44, 47, 70, 71, 72, 73, 74, 77, 100, 101, 102, 103, 104, 107, 110, 111, 112, 114, 117, 120, 121, 122, 123, 124, 127, 140, 141, 142, 143, 144, 147, 170, 171, 172, 173, 174, 177, 200, 201

The OEIS comments include the following Python code:
from itertools import islice
from num2words import num2words
def agen(): yield from (k for k in range(10**6) if "i" not in num2words(k))
print(list(islice(agen(), 60)))

This doesn't work so I asked Google's Bard to fix the problem and it said to add the line "import num2words". This gives the following code: 

import num2words
from itertools import islice
from num2words import num2words
def agen(): yield from (k for k in range(10**6) if "i" not in num2words(k))
print(list(islice(agen(), 60)))

This code actually works using SageMath on my laptop and generates the entire 30276 numbers by replacing the 60. However, it still won't run on SageMathCell or online Python compiler like Programitz.

The num2words works as shown in Figure 1:


Figure 1

 There are many iban numbers in the range between 27000 and 28000. Here they are:

27000, 27001, 27002, 27003, 27004, 27007, 27010, 27011, 27012, 27014, 27017, 27020, 27021, 27022, 27023, 27024, 27027, 27040, 27041, 27042, 27043, 27044, 27047, 27070, 27071, 27072, 27073, 27074, 27077, 27100, 27101, 27102, 27103, 27104, 27107, 27110, 27111, 27112, 27114, 27117, 27120, 27121, 27122, 27123, 27124, 27127, 27140, 27141, 27142, 27143, 27144, 27147, 27170, 27171, 27172, 27173, 27174, 27177, 27200, 27201, 27202, 27203, 27204, 27207, 27210, 27211, 27212, 27214, 27217, 27220, 27221, 27222, 27223, 27224, 27227, 27240, 27241, 27242, 27243, 27244, 27247, 27270, 27271, 27272, 27273, 27274, 27277, 27300, 27301, 27302, 27303, 27304, 27307, 27310, 27311, 27312, 27314, 27317, 27320, 27321, 27322, 27323, 27324, 27327, 27340, 27341, 27342, 27343, 27344, 27347, 27370, 27371, 27372, 27373, 27374, 27377, 27400, 27401, 27402, 27403, 27404, 27407, 27410, 27411, 27412, 27414, 27417, 27420, 27421, 27422, 27423, 27424, 27427, 27440, 27441, 27442, 27443, 27444, 27447, 27470, 27471, 27472, 27473, 27474, 27477, 27700, 27701, 27702, 27703, 27704, 27707, 27710, 27711, 27712, 27714, 27717, 27720, 27721, 27722, 27723, 27724, 27727, 27740, 27741, 27742, 27743, 27744, 27747, 27770, 27771, 27772, 27773, 27774, 27777

Prior to 27000, the last iban number is 24777 and after 27777, the next is 40000.  Figure 2 shows a plot of the iban numbers.


Figure 2

While we're at it, we may as well look at similar types of numbers. Let's start with aban numbers. Numbers Aplenty defines these as follows:
A number is called aban if its name (in English) does not contain the letter "a". The word "and" is not counted and in general I do not use it when I spell out numbers. Among the words used to construct numbers names, only the word "thousand" contains an "a" so the aban numbers are the numbers from 1 to 999, from 1000000 to 1000999, from 2000000 to 2000999, and so on. The sum of the reciprocals of aban numbers does not converge and grows slowlytowards infinity.

Figure 3 shows a graph of the initial aban numbers up to 1000 which are:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 200, 300, 400, 500, 600, 700, 800, 900


Figure 2

Next we'll consider eban numbers defined as follows by Numbers Aplenty:
A number is called eban if its name (in English) does not contain the letter "e".
It is easy to see that the eban numbers are all even and their last two digits must be one of 02, 04, 06, 30, 32, 34, 36, 40, 42, 44, 46, 50, 52, 54, 56, 60, 62, 64, or 66.

Here are the initial members and Figure 3 shows a plot of these numbers:

2, 4, 6, 30, 32, 34, 36, 40, 42, 44, 46, 50, 52, 54, 56, 60, 62, 64, 66, 2000, 2002, 2004, 2006, 2030, 2032, 2034, 2036, 2040, 2042, 2044, 2046, 2050, 2052, 2054, 2056, 2060, 2062, 2064, 2066, 4000, 4002, 4004, 4006, 4030, 4032, 4034, 4036, 4040, 4042, 4044, 4046, 4050, 4052, 4054, 4056, 4060, 4062, 4064, 4066, 6000, 6002, 6004, 6006, 6030, 6032, 6034, 6036, 6040, 6042, 6044, 6046, 6050, 6052, 6054, 6056, 6060, 6062, 6064, 6066, 30000, 30002, 30004, 30006, 30030, 30032, 30034, 30036, 30040, 30042, 30044, 30046, 30050, 30052, 30054, 30056, 30060, 30062, 30064, 30066, 32000, 32002, 32004, 32006, 32030, 32032, 32034, 32036, 32040, 32042, 32044, 32046, 32050, 32052, 32054, 32056, 32060, 32062, 32064, 32066, 34000, 34002, 34004, 34006, 34030, 34032, 34034, 34036, 34040, 34042, 34044, 34046, 34050, 34052, 34054, 34056, 34060, 34062, 34064, 34066, 36000, 36002, 36004, 36006, 36030, 36032, 36034, 36036, 36040, 36042, 36044, 36046, 36050, 36052, 36054, 36056, 36060, 36062, 36064, 36066, 40000, 40002, 40004, 40006, 40030, 40032, 40034, 40036, 40040, 40042, 40044, 40046, 40050, 40052, 40054, 40056, 40060, 40062, 40064, 40066, 42000, 42002, 42004, 42006, 42030, 42032, 42034, 42036, 42040, 42042, 42044, 42046, 42050, 42052, 42054, 42056, 42060, 42062, 42064, 42066, 44000, 44002, 44004, 44006, 44030, 44032, 44034, 44036, 44040, 44042, 44044, 44046, 44050, 44052, 44054, 44056, 44060, 44062, 44064, 44066, 46000, 46002, 46004, 46006, 46030, 46032, 46034, 46036, 46040, 46042, 46044, 46046, 46050, 46052, 46054, 46056, 46060, 46062, 46064, 46066, 50000, 50002, 50004, 50006, 50030, 50032, 50034, 50036, 50040, 50042, 50044, 50046, 50050, 50052, 50054, 50056, 50060, 50062, 50064, 50066, 52000, 52002, 52004, 52006, 52030, 52032, 52034, 52036, 52040, 52042, 52044, 52046, 52050, 52052, 52054, 52056, 52060, 52062, 52064, 52066, 54000, 54002, 54004, 54006, 54030, 54032, 54034, 54036, 54040, 54042, 54044, 54046, 54050, 54052, 54054, 54056, 54060, 54062, 54064, 54066, 56000, 56002, 56004, 56006, 56030, 56032, 56034, 56036, 56040, 56042, 56044, 56046, 56050, 56052, 56054, 56056, 56060, 56062, 56064, 56066, 60000, 60002, 60004, 60006, 60030, 60032, 60034, 60036, 60040, 60042, 60044, 60046, 60050, 60052, 60054, 60056, 60060, 60062, 60064, 60066, 62000, 62002, 62004, 62006, 62030, 62032, 62034, 62036, 62040, 62042, 62044, 62046, 62050, 62052, 62054, 62056, 62060, 62062, 62064, 62066, 64000, 64002, 64004, 64006, 64030, 64032, 64034, 64036, 64040, 64042, 64044, 64046, 64050, 64052, 64054, 64056, 64060, 64062, 64064, 64066, 66000, 66002, 66004, 66006, 66030, 66032, 66034, 66036, 66040, 66042, 66044, 66046, 66050, 66052, 66054, 66056, 66060, 66062, 66064, 66066


Figure 3

This leads on to the oban numbers defined as follows by Numbers Aplenty:
A number is called oban if its name (in English) does not contain the letter "o".
Assuming that the name of every power of 10 greater than  $10^5$  ends in "-illion" (like million, billion, trillion, etc.), then the oban numbers are finite. There are 454 of them, the largest begin 999.

The numbers are as follows with Figure 4 providing a graph of these numbers. 

3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 23, 25, 26, 27, 28, 29, 30, 33, 35, 36, 37, 38, 39, 50, 53, 55, 56, 57, 58, 59, 60, 63, 65, 66, 67, 68, 69, 70, 73, 75, 76, 77, 78, 79, 80, 83, 85, 86, 87, 88, 89, 90, 93, 95, 96, 97, 98, 99, 300, 303, 305, 306, 307, 308, 309, 310, 311, 312, 313, 315, 316, 317, 318, 319, 320, 323, 325, 326, 327, 328, 329, 330, 333, 335, 336, 337, 338, 339, 350, 353, 355, 356, 357, 358, 359, 360, 363, 365, 366, 367, 368, 369, 370, 373, 375, 376, 377, 378, 379, 380, 383, 385, 386, 387, 388, 389, 390, 393, 395, 396, 397, 398, 399, 500, 503, 505, 506, 507, 508, 509, 510, 511, 512, 513, 515, 516, 517, 518, 519, 520, 523, 525, 526, 527, 528, 529, 530, 533, 535, 536, 537, 538, 539, 550, 553, 555, 556, 557, 558, 559, 560, 563, 565, 566, 567, 568, 569, 570, 573, 575, 576, 577, 578, 579, 580, 583, 585, 586, 587, 588, 589, 590, 593, 595, 596, 597, 598, 599, 600, 603, 605, 606, 607, 608, 609, 610, 611, 612, 613, 615, 616, 617, 618, 619, 620, 623, 625, 626, 627, 628, 629, 630, 633, 635, 636, 637, 638, 639, 650, 653, 655, 656, 657, 658, 659, 660, 663, 665, 666, 667, 668, 669, 670, 673, 675, 676, 677, 678, 679, 680, 683, 685, 686, 687, 688, 689, 690, 693, 695, 696, 697, 698, 699, 700, 703, 705, 706, 707, 708, 709, 710, 711, 712, 713, 715, 716, 717, 718, 719, 720, 723, 725, 726, 727, 728, 729, 730, 733, 735, 736, 737, 738, 739, 750, 753, 755, 756, 757, 758, 759, 760, 763, 765, 766, 767, 768, 769, 770, 773, 775, 776, 777, 778, 779, 780, 783, 785, 786, 787, 788, 789, 790, 793, 795, 796, 797, 798, 799, 800, 803, 805, 806, 807, 808, 809, 810, 811, 812, 813, 815, 816, 817, 818, 819, 820, 823, 825, 826, 827, 828, 829, 830, 833, 835, 836, 837, 838, 839, 850, 853, 855, 856, 857, 858, 859, 860, 863, 865, 866, 867, 868, 869, 870, 873, 875, 876, 877, 878, 879, 880, 883, 885, 886, 887, 888, 889, 890, 893, 895, 896, 897, 898, 899, 900, 903, 905, 906, 907, 908, 909, 910, 911, 912, 913, 915, 916, 917, 918, 919, 920, 923, 925, 926, 927, 928, 929, 930, 933, 935, 936, 937, 938, 939, 950, 953, 955, 956, 957, 958, 959, 960, 963, 965, 966, 967, 968, 969, 970, 973, 975, 976, 977, 978, 979, 980, 983, 985, 986, 987, 988, 989, 990, 993, 995, 996, 997, 998, 999


Figure 4

Last come uban numbers defined by Numbers Aplenty as follows:
A number is called uban if its name (in English) does not contain the letter "u".
In particular, it cannot contain the terms "four", "hundred", and "thousand", So the uban number following 99 is 1000000. Despite being quite sparse, the sum of the reciprocals of uban numbers slowly diverges.

Here is a list of the initial uban numbers:

0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99

Of course, you could choose the absence of certain consonants as well if you wanted to and the so-called tban numbers are in fact listed as OEIS A008523. The initial members of the sequence are:

0, 1, 4, 5, 6, 7, 9, 11, 100, 101, 104, 105, 106, 107, 109, 111, 400, 401, 404, 405, 406, 407, 409, 411, 500, 501, 504, 505, 506, 507, 509, 511, 600, 601, 604, 605, 606, 607, 609, 611, 700, 701, 704, 705, 706, 707, 709, 711, 900, 901, 904, 905, 906, 907, 909, 911, 1000000, 1000001, 1000004, 1000005 

That's probably enough as these types of numbers have no real mathematical significance but it was interesting to come across the idea of them and is relevant to my previous post on Numbers and Letters from July 21st 2023.

Tuesday, 8 February 2022

More Wordle Statistics

My last post titled Wordle Statistics was long enough so I didn't want to add more newly found information to that and hence I'm making a fresh post. 3Blue1Brown has just created a YouTube video that involves a statistical analysis of Wordle.


There's a lot to digest in this video but my main takeaway after first viewing it was that CRANE was a good starting word! I clearly need to watch it again and again to fully absorb what he's saying. However, for today's Wordle I started with CRANE and the results were almost disastrous as can be seen in Figure 1.


Figure 1

Looking at Figure 1, it can be seen that I had a spectacular start with three letters in the correct positions. There were only two remaining letters to guess. However, I nearly failed because there were just so many possible words that could be made from *RA*E. 

Referring to kaggle, a database of English word frequencies, we can see that TRADE was a good second choice because it has by far the highest frequency. Had I known about word frequencies, my third choice would have been FRAME and I would have solved the puzzle in a mere three attempts.

CRANE: 4,888,961 FIFTH

                                        TRADE: 110,086,585 FIRST

                                        ERASE: 3,086,642 SIXTH

                                        GRACE: 17,642,126 THIRD

BRAKE: 9,321,885 FOURTH

                                        FRAME: 46,079,991 SECOND 

Using Google search with quotes e.g. "trade" yields the following statistics:

CRANE: 166,000,000 SIXTH

                                         TRADE: 1,930,000,000 SECOND

                                         ERASE:  242,000,000 FIFTH

                                         GRACE:  918,000,000 THIRD

 BRAKE:  503,000,000 FOURTH

                                         FRAME:   2,350,000,00 FIRST

Interestingly, using the Google search, FRAME and TRADE swap places with the former being markedly more frequent (in searches at least). CRANE and ERASE also swap positions in fifth and sixth places.

I downloaded the CSV file of word frequencies from kaggle (it's only 5MB) and filtered out words that were not five letters in length. Here are the initial five letter words with the highest frequencies:

about 1,226,734,006

other 978,481,319

which 810,514,085

their         782,849,411

there 701,170,205

first         578,161,543

would 572,644,147

these 541,003,982

click         536,746,424

price         501,651,226

state         453,104,133

email 443,949,646

world 431,934,249

music 414,028,837

after         372,948,094

video 365,410,017

where 360,468,339

books 347,710,184

links         339,926,541

years 337,841,309

As can be seen, ABOUT comes out clearly on top with a frequency of over 1.2 billion! This might not be a bad starting word. Anyway, more food for thought went tackling Wordle.

Monday, 7 February 2022

Wordle Statistics


In my Pedagogical Posturing blog, I recently posted about Wordle but in post I want to focus on the statistics of the letter frequencies. Of primary interest of course is how frequently the various letters of the alphabet occur within the Wordle "universe". In A Mathematician's Guide to Wordle, it's explained that:

Wordle has both a ‘source’ word list and a ‘target’ word list. You can guess anything from the source word list (which is the 5 letter words from CSW19) ... The target word list is a small hand-curated subset of less than 2500 of these words.

CSW stands for Collins Scrabble Words that consists of 279,496 words. The article just quoted from goes on to say that:

It is well known that when you order letters by frequency of appearance in English words, you get ETAOIN SHRDLU. However ... if you take all 5 letter words in CSW19, you get SEAORY LTNUDY.

Figure 1 shows the full sequence of letters and their relative frequencies. The commentary on this chart includes:

  • In fact, they're essentially tied, S appearing only three more times than E in the 64,860 letters in the word list. That's a 0.0046 percentage point difference.

  • After those two, the distribution doesn't fall off that much. A is 9.2%, O is 6.8%, R is 6.4%.

  • The top 10 most frequent letters in the list make up 67% of the occurrences. That's all five vowels, plus the Wheel of Fortune consonants, R S T L N.

  • For those of you wondering about that "other" vowel, Y is 12th at 3.2%.

  • The least common 5 letters, Q X J Z V, combine for a mere 2.8% of the occurrences, about the same as the letter H, the 16th ranked letter.

  • The most common letter, S, is overwhelmingly more likely to be in fifth position (59%). Otherwise, it's more likely that it appears first (23%) than in any of the middle positions combined.

  • Vowels occur most commonly in the second position. That is unless you're E, which is more common in the fourth spot (35%) than second (24%). Again, "-ed" words are a plausible explanation.

  • For you Y fans: The pseudo-vowel shows up in the last spot 63% of the time when it appears.

  • Of the most common letters, L has the most level distribution, appearing most in the third position (25%) and least in the last position (14%).

  • Words in which letters appear twice make up a little more than 35.8% of the accepted word list.


Figure 1: source

Looking at Figure 1, it would seem that the AROSE would be a good starting point. Figure 2 shows the positions within a word of the most common letters.


Figure 2: source

Figure 2 shows that S occurs most frequently in the final position and so the previous choice of AROSE is perhaps not as good a choice as it first seemed. There are no permutations of this word that have S in the final position. Finally Figure 3 shows the frequency of letters occurring twice in a word compared with their overall frequency.


Figure 3: source

Given that both E are S more likely to occur twice in a word, it would seem that EASES might be good choice of starting word. Some other suggested starting words are:

  • TARES
  • SORES
  • CARES
  • CORES
  • REAIS
  • BLAHS
  • SOLAR
There are a lot of factors to consider but this post is at least a start and will definitely improve my Wordle prowess.