FiveThirtyEight has a great quiz about Number words here . I thought this was really interesting and so had a think about it and started to generalize. I realized that as numbers grew the alphanumeric value would diminish in comparison, so I stopped just before one million. I threw some logic into Python and generated a dataset with I put into Qlik Sense for analysis. Here is what I found

Max alphanumeric value is 730, this is for 777,777. This is not a surprise as 7 has the highest alphanumeric value in the one through 9 integers

Here is the full distribution

Obviously as we start to add integers there is a jump as we have more words, max alphanumeric value for integers under 100k, 6 digits in the iteger, is 591. Under 10k the largest alphanumeric value is 481. You can see fairly steady growth of number of digits in the integer and the average alphanumeric value for that group of integers.

Starting with our overall maximum alphanumeric value we should only look at integers below 1000 to see a reasonably close relationship between integer values and their alphanumeric values. The largest alphanumeric value under 1000 is 314, so lets look at all integers below 350

I will post the answer after 538 does, but for now you can explore the below logic.

Description of below is basically all integers or alphanumerics have a distinct number of possibilities. In fact for all numbers below one million there are only 30 distinct alphanumerics. There are represented in the lists below.

You have distinct names for each number one through nineteen. 1 = one, 17 = seventeen.

Then for two digit numbers you can combine the names of the 10x numbers with alphanumeric value for one through nine and a zero length string for zero. 21 = twenty + one, 50 = fifty + “”.

Hundreds and thousands operate the same way and in conjunction with the above. Logic is below

Description of below logic is basically all integers or alphanumerics have a distinct number of possibilities.

You have distinct names for each number one through nineteen. 1 = one, 17 = seventeen.

Then for two digit numbers you can combine the names of the 10x numbers with alphanumeric value for one through nine and a zero length string for zero. 21 = twenty + one, 50 = fifty + “”.

Hundreds and thousands operate the same way and in conjunction with the above. Logic is below.

If you are good at python and can make this quicker we could add millions, I think multiprocessing or vectorizing in pandas would both be good options!

```
#Python Code
small = {0:'',1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thirteen', 14: 'fourteen', 15: 'fifteen', 16: 'sixteen', 17: 'seventeen', 18: 'eighteen', 19: 'nineteen'}
tens = {2:'twenty', 3:'thirty', 4:'forty', 5:'fifty', 6:'sixty', 7:'seventy', 8:'eighty', 9:'ninety'}
e = {2:'hundred',3:'thousand'}
map = {'z':26,'y':25,'x':24,'w':23,'v':22,'u':21,'t':20,'s':19,'r':18,'q':17,'p':16,'o':15,'n':14,'m':13,'l':12,'k':11,'j':10,'i':9,'h':8,'g':7,'f':6,'e':5,'d':4,'c':3,'b':2,'a':1}
#thousand
def thou(n):
tnum = n[:-3]
tdig = len(tnum)
if tdig == 1:
twrd = small[int(tnum)]+e[3]
elif tdig == 2:
twrd = r2(tnum)+e[3]
elif tdig == 3:
twrd = hun(tnum)+r2(tnum)+e[3]
else:
twrd = ''
return twrd
#hundred
def hun(n):
if len(n) > 2:
hnum = int(n[-3:-2])
if hnum == 0:
hundred=''
else:
hundred=e[2]
hwrd = small[hnum]+hundred
else:
hwrd = ''
return hwrd
#right 2
def r2(n):
rnum = int(n[-2:])
if rnum == 0:
rwrd = ''
elif rnum < 20:
rwrd = small[rnum]
else:
rwrd = tens[int(list(str(rnum))[0])]+small[int(list(str(rnum))[1])]
return rwrd
def word(n):
n = str(n)
return thou(n)+hun(n)+r2(n)
def wrdsum(n):
wrd = word(n)
return [n,wrd,sum([map[x] for x in wrd])]
def wrdlist(n):
a=[]
for i in range(1,n):
a.append(wrdsum(i))
return a
```