[Question]
  [
Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so `101` is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is `10^6` and one billion is `10^9`.
```
a 1000                           one thousand
b 1000000000                     one billion
c 1000000000000000000000000000   one octillion
d 100                            one hundred
e 0                              zero
f 4                              four
g 8                              eight
h 3                              three
i 5                              five
j 
k
l 11                             eleven
m 1000000                        one million
n 1                              one
o 0                              zero
p 1000000000000000000000000      one septillion
q 1000000000000000               one quadrillion
r 0                              zero
s 6                              six
t 2                              two
u 4                              four
v 5                              five
w 2                              two
x 6                              six
y 20                             twenty
z 0                              zero
```
J and K are not part of the input specification, so your behavior is undefined for them. Given one of the above letters, output the (decimal) number next to it. You can take input in lowercase or uppercase, but you cannot require that some inputs are lowercase and others uppercase.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer in bytes wins.
  
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~78 75 74~~ 73 bytes
```
c=>(n=([x]=Buffer(c+'8>P7 $(#%  +;! MD &"$%"&4 '))[x-96]-53)<0?n+21:10**n
```
[Try it online!](https://tio.run/##BcFJDoIwFADQq3yRoQVpwFmxmBi3Ju4JCywtYqBFJtHL1/de2Zh1rC2b3pcq51pQzWiMJEXJlNLLIARvEfOcfXzfgYnmFoAXzeB2BdswLcNeg4NxMvmHbepvVvgUnKW3DI9h4LpSRwkhxMkeLOeieJZVLVXzbrt@GD/T9@ekpM4axIDGwJTsVMVJpQrEFiAQwxjrPw "JavaScript (Node.js) – Try It Online")
### How?
Each value is encoded with a single printable character. We use the ASCII range \$[32..52]\$ to encode \$n-32\$ and the range \$[53..80]\$ to encode \$10^{n-53}\$.
### Commented
```
c =>                                   // c = input character
  ( n =                                //
    ( [x] =                            // let x be the 1st byte of the
        Buffer(                        // buffer made of:
          c +                          //   c followed by
          '8>P7 $(#%  +;! MD &"$%"&4 ' //   the encoded values
        )                              //
    )[x - 96]                          // let n be the encoded value corresponding to c
    - 53                               // minus 53
  ) < 0 ?                              // if n is negative:
    n + 21                             //   return n + 21
  :                                    // else:
    10 ** n                            //   return 10 ** n
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 33 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
º░¡µ?Äz*B╥╪╩ΓoΣ4ù↓|♂5%⌡ÿΩ²┼h{☻4O└
```
[Run and debug it](https://staxlang.xyz/#p=a7b0ade63f8e7a2a42d2d8cae26fe43497197c0b3525f598eafdc5687b02344fc0&i=a%0Ab%0Ac%0Ad%0Ae%0Af%0Ag%0Ah%0Ai%0Al%0Am%0An%0Ao%0Ap%0Aq%0Ar%0As%0At%0Au%0Av%0Aw%0Ax%0Ay%0Az&a=1&m=2)
### Procedure:
1. Extract codepoint from input.
2. Index into constant array `[3, 5, 7, 9, 11, -6, 1, 0, -24, -15, 0, 6, 2, 4, 5, 2, 6, 20, 0, -3, -9, -27, -2, 0, 4, 8]` using codepoint. (with wrap-around)
3. If the result is negative, negate and raise `10` to that power, otherwise leave as-is.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 65 bytes
```
->n{i="CI[B?;7<:??4F>?XO?9=;:=9+?"[n.ord-65].ord-64;i>0?10**i:~i}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOtNWydkz2sne2tzGyt7exM3OPsLf3tLW2srWUtteKTpPL78oRdfMNBZCm1hn2hnYGxpoaWVa1WXW/tewd9TTs4/S1MtNLKiuyaopUIjO0kmLzoqNrf0PAA "Ruby – Try It Online")
Improvements inspired by GB's comment.
# [Ruby](https://www.ruby-lang.org/), 70 bytes
```
->n{i="ci}b@DHCE@@KfA@xo@FBDEBFT@"[n.ord-65].ord;i>96?10**(i-96):i-64}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOtNWKTmzNsnBxcPZ1cHBO83RoSLfwc3JxdXJLcRBKTpPL78oRdfMNBZEW2faWZrZGxpoaWlk6lqaaVpl6pqZ1P7XsHfU07OP0tTLTSyorsmqKVCIztJJi86Kja39DwA "Ruby – Try It Online")
[Answer]
# [///](https://esolangs.org/wiki////), 125 bytes
```
/:/\/\///T/000:d/100:a/d0:m/aT:b/aTT:q/bTT:p/qTTT:c/pT:e/0:f/4:g/8:h/3:i/5:l/11:n/1:o/0:r/0:s/6:t/2:u/4:v/5:w/2:x/6:y/20:z/0/
```
[Try it online!](https://tio.run/##DYpHDsNADAPv/AzXTkHAd@wxF3c7cc26f94RBA0JaUKbhLoI10XxbUN6OueUMzImzJ06Jl6pwWtiahw5eYuMo1dBp5J3VXyp5k0NH2oZReoZabDnzzbwqZmxFhNXEzbru90Oxk4nHa8EKTLkKFCiQo0GH3zRokOPASMm/BAwY8GKDTsOnNcf "/// – Try It Online")
Input is appended to the end of the code, as per [I/O meta](https://codegolf.meta.stackexchange.com/a/10553/86422). The footer in the above TIO link tests all letters simultaneously, as a single newline-delimited string, but the code also works just fine when inputting [a single character](https://tio.run/##DYpJDsJADASfVJ6wCPU7fOQyWSBIARIGCPD5wbJc3bKrTLmMQ6kVcYwBx8zUk4KZ3nQlu9qAa6ENziwe0TG7Bkwntjpz0MhGF3aaSEk3ku7xfMQW9nrS6BXiO4Q1@iduXxrTD6Or9Q8).
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 50 bytes
Letters b, c, m, p and q are skipped for performance reasons when testing on TIO. 
```
(i=0;While[1>StringCount[IntegerName@i,#],i++];i)&
```
[Try it online!](https://tio.run/##Pcu9CsIwGIXh3asoEURpBl3tDwWl4CKCgkPIEDRtP2gTqKlGS689HhAcnuXlnE65RnfK0U2FMgtLytbJtaFWi01@dj2ZemcH48TBOF3r/qg6XRCfS05xLBNaLcLeihN2Tlzs71D4NGfbiKX5v5TCS8mj0fORKcbZHTRUUEMDBC0YsNDDAxwM8IQXeHjDh02TnIUv "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# Excel, 85 bytes
```
=CHOOSE(CODE(A1)-96,1E3,1E9,1E27,100,,4,8,3,5,,,11,1E6,1,,1E24,1E15,,6,2,4,5,2,6,20,)
```
2 Golfy bits:
* Using exponents (e.g. `1E15`) saves `26 bytes`.
* Default of `CHOOSE` when nothing is provided is `0`, saves `4 bytes`
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 36 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
•—ÃÅ¸usδtθ}™-5„©‘öæH•57в₆-sÇ`èD0‹iÄ°
```
Port of [*@recursive*'s Stax answer](https://codegolf.stackexchange.com/a/191242/52210).  
Input in lowercase.
[Try it online](https://tio.run/##AUwAs/9vc2FiaWX//@KAouKAlMODw4XCuHVzzrR0zrh94oSiLTXigJ7CqeKAmMO2w6ZI4oCiNTfQsuKChi1zw4dgw6hEMOKAuWnDhMKw//9h) or [verify all test cases](https://tio.run/##AVoApf9vc2FiaWX/QXZ5PyIg4oaSICI/ef/igKLigJTDg8OFwrh1c860dM64feKEoi014oCewqnigJjDtsOmSOKAojU30LLigoYtc8OHYMOoRDDigLlpw4TCsP99LP8).
**Explanation:**
```
•—ÃÅ¸usδtθ}™-5„©‘öæH• # Push compressed integer 3133432551338094772548436198140408157771728287
 57в                  # Converted to base-57 as list: [39,41,43,45,47,30,37,36,12,21,36,42,38,40,41,38,42,56,36,33,27,9,34,36,40,44]
    ₆-                # Subtract 36 from each: [3,5,7,9,11,-6,1,0,-24,-15,0,6,2,4,5,2,6,20,0,-3,-9,-27,-2,0,4,8]
      sÇ`             # Swap to take the input, and convert it to its unicode value
         è            # Index it into the list (with automatic wraparound)
          D0‹i        # Create a copy, and if this is negative:
              Ä       #  Take the absolute value
               °      #  And then take 10 the power this value
                      # (implicitly output the top of the stack as result)
```
[See this 05AB1E tip of mine (section *How to compress large integers?* and *How to compress integer lists?*)](https://codegolf.stackexchange.com/a/166851/52210) to understand why `•—ÃÅ¸usδtθ}™-5„©‘öæH•` is `3133432551338094772548436198140408157771728287` and `•—ÃÅ¸usδtθ}™-5„©‘öæH•57в` is `[39,41,43,45,47,30,37,36,12,21,36,42,38,40,41,38,42,56,36,33,27,9,34,36,40,44]`.
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 84 bytes
```
$_=(1e3,1e9,1e27,100,0,4,8,3,5,1,1,11,1e6,1,0,1e24,1e15,0,6,2,4,5,2,6,20,0)[-65+ord]
```
[Try it online!](https://tio.run/##FYtJC8IwFITv8zs8KL5C0jZRDx7c17rvIoIYJFDaUPv7ja/MwneYcaZIlfe1Z7cuTUTSdDhhi6QQJCimNkWkSFZiG80gqkXMJRWzppBnipuJP417oFUzL94P73voY4AhRhhjgilmmGOBJRKssMYGW@ywxwFHnHDGBVfcfrkrbZ59fZC87MdmpQ9c@gc "Perl 5 – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 103 bytes
```
lambda x:(1000,10**9,10**27,100,0,4,8,3,5,0,0,11,10**6,1,0,10**24,10**15,0,6,2,4,5,2,6,20,0)[ord(x)-97]
```
[Try it online!](https://tio.run/##JYpNDsIgGAX3noJdoflMgP438STqogWxTVpArNp6eaS4mTfJG7stg9GZV6eLn7q5lx1aW8wopcBomjaRvApDgUIONWRQwO6Mxa8EBv@W53HYfpfAQ1wEBgs1ORsn8UqOTXX1yjgk0KhR0vVC3tR9GKdZG/twz@X1/qzbN2kPyLpRL1gAUlgQ4n8 "Python 3 – Try It Online")
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), ~~77~~ ~~74~~ 68 bytes
```
x=>((x="1‘Ʊ!  
aƁñ"[x-65])&15)*Math.Pow(10,x>>4)
```
Encodes each letter's output as \$a \times 10^b\$, where \$a\$ is represented by the lowest 4 bits of the character, while \$b\$ is represented by the next five bits after that. Uses capital letters.
**Commented**
```
x=>                                                 //Lambda taking in a char
  (x=                                         )     //Re-assign x to
     "1‘Ʊ!   
aƁñ"[x-65]      //The character's value at index x-65
 (                                             &15) //Bitwise AND by 15                                
  * Math.Pow(10,x>>4)                               // Multiplied by 10**(floor(x/16))
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9Wmpdsk5yRWKSTkl@alJNql2b7v8LWTkOjwlbJ8NDEYxsVBVg4mFkVFLgTGQWONR7eKMDGxMLKxCYkoBRdoWtmGqupZmiqqeWbWJKhF5BfrmFooFNhZ2ei@d@aKy2/SANkskKmgq2CuqO6NZBhA2RFgVja2poK1VycmWkKGkBpoKi3ukJNjQKE7aWuqRBelFmS6pOZlwqU11ZQslIozUtJTQPyU5Q0rbk4U3OKUzHVKAGpNI1MTaCK2v8A "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 67 bytes
```
{/\-/??10**-$_!!$_}o{'`ZHacgkfhccn]dcKTciegheiwc'.ords[.ord-97]-99}
```
[Try it online!](https://tio.run/##jZJfT8IwFMXf@ynuImHKsn@oKDHCq4mvPikER9etla2FdgMH4bNPpiOaIN3uQx@aX@85OadLIpNBmRbQjeARyp07sd3x2Pd6PbszM4zObC925vvrU4DjRUQx5tMQP79gRmJK2AabjpCheqtOe3g3tYfDfamCApzDukhIMAPTccyt@YAuquuEcaJGI6e7u0xdz7MOUnbHdbBI54Zhpe4ktNwr67DEwVSqMgDf8zw4P4ITyKjIVcBDNP@mf@YsPWdJwgRH@A98OjUscFbjYYVDgxOa81CSEBHQogBbIgWK4EZPRSKXKIZ7PUVYTDNE4VqPZVQSghjcNmiyNUEfgBYoAd/XCydkTThKj0HqkknrGDnod1YwEq3iW54v8FdXkeWxwdUJ/4/PVR6Esn4gW9lQMNBTin2iDPoN7WwEylv9h3WrBjdtBD/bWC@g7zVsIjwr0LZNWl8 "Perl 6 – Try It Online")
Uses a lookup table where a negative number means that is the negative of the exponent, otherwise it is the number itself.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 32 bytes
```
•н“вüQ;æ¡ζæÀÛß%aÜ×₃t•56вsCè2‰`i°
```
[Try it online!](https://tio.run/##AVsApP9vc2FiaWX/QXZ5PyIgLT4gIj95/@KAotC94oCc0LLDvFE7w6bCoc62w6bDgMObw58lYcOcw5figoN04oCiNTbQsnNDw6gy4oCwYGnCsP99LP//LS1uby1sYXp5 "05AB1E – Try It Online")
```
•н“вüQ;æ¡ζæÀÛß%aÜ×₃t•56в  # compressed list:
# [31, 0, 12, 4, 8, 10, 4, 12, 40, 0, 7, 19, 55, 5, 0, 8, 16, 6, 10, 1, 1, 22, 13, 2, 0, 49]
s                         # swap so the input is at the top
 C                        # parse input as "binary" (a -> 36, b -> 37, ...)
  è                       # index (wraps around)
   2‰                     # divmod 2: [n / 2, n % 2]
     `                    # dump both on the stack
      i                   # if the modulo is 1:
       °                  #  10 ** the quotient
                          # implicit output
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), ~~129~~ 100 bytes
```
A=xDVw04835zzbA10SJ0624526k0
c=$[64#${A:$[64#$1-10]:1}]
[ $c -gt 30 ]&&printf 1%0$[c-30].0f||echo $c
```
[Try it online!](https://tio.run/##S0oszvj/39G2wiWs3MDEwti0qirJ0dAg2MvAzMjE1Mgs24Ar2VYl2sxEWaXa0QrCMNQ1NIi1MqyN5YpWUElW0E0vUTA2UIhVUysoyswrSVMwVDVQiU7WNTaI1TNIq6lJTc7IB6r7//9/DgA "Bash – Try It Online")
~~[Try it online!](https://tio.run/##S0oszvj/39G2wiWs3MDEwti0qirJ0dAg2MvAzMjE1Mgs24Ar2VYl2sxEWaXa0QrCMNQ1NIi1MqyN5UrLL9LQsFaJTrYxNoi11tSsVkhNzshXUEm2Tq3ILLGu5SooyswrSVMwRKi0A6lM1tUFKYbKGljX/v//Pw0A "Bash – Try It Online")~~
### How it works:
```
A=xDVw04835zzbA10SJ0624526k0
```
$A: Base64 encoded "a"-"z": numbers less than 100 are stored directly. Larger numbers are encoded as the number of zeros +30. (ex: 1,000 = 33, 100 = 32, etc.)
```
c=$[64#${A:$[64#$1-10]:1}]
```
Extract one letter from $A at position specified in argument $1 (base64 decoded, -10 to account for offset of 'a'). Base64 decode that character and store in c.
```
[ $c -gt 30 ]&&printf 1%0$[c-30].0f||echo $c
```
If $c is greater than 30, print "1" padded with $c-30 zeros. Else, print $c.
[Answer]
# [Sledgehammer](https://github.com/tkwa/Sledgehammer), 17 bytes
Technically, this is 133 bits long, but that doesn't really make this 16.625 bytes, as the compressor claims.
```
⣜⢍⢞⢹⡱⡋⣽⡱⡆⢺⢦⡽⡐⡌⢗⠈⣵
```
This probably decodes to
```
x1 = Input[]; x2 = 0; While[StringFreeQ[IntegerName[x2], x1], x2++]; Print[x2]
```
(approximately the same as my Mathematica answer), although I barely got it encoded (it appears as though my PC has compatibility issues with everything), so good luck decoding it again to check. I might have made some mistakes while using the encoder, so be careful.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 11 bytes
```
λ∆ċ‛λ¬-?c;ṅ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwizrviiIbEi+KAm867wqwtP2M74bmFIiwiIiwiZlxuZ1xuaFxubFxueSJd)
Very literal implementation of the title.
## Explained
```
λ∆ċ‛λ¬-?c;ṅ
λ        ;ṅ  # The first number
 ∆ċ‛λ¬-      #   (converted to words, with any "and"s removed)
       ?c    # to contain the input
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 36 bytes
```
Oị“[@ịẆþĊ`o&÷ḲḞṘḂỊP¥t’b48¤_⁹⁵*ɗ¹>?20
```
[Try it online!](https://tio.run/##AWQAm/9qZWxsef//T@G7i@KAnFtA4buL4bqGw77EimBvJsO34biy4bie4bmY4biC4buKUMKldOKAmWI0OMKkX@KBueKBtSrJl8K5Pj8yMP874oCcIC0@IOKAnTvDhwrDmGHDh@KCrFn/ "Jelly – Try It Online")
A monadic link taking a lower case letter as its argument and returning an integer. Returns `0` for `j` and `k`. 
## Explanation
```
O                       | Convert to code point
 ị          ¤           | Index into following as a nilad (wraps around):
  “[...t’               | - Integer 5370441668223940717846370165240010583188867 (stored base 250)
         b48            | - Convert to base 48
                 ɗ >?20 | If >20, following as a dyad using 20 as right argument:
             _⁹         | - Subtract right argument (20)
               ⁵*       | - 10 to the power of this
                  ¹     | Else: leave unchanged (identity function)
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 89 bytes
```
^
$'
T`l`111104835__111011062452620`^.
T`abcm\pq`139285
\d$
$*0$&$*0$&$*0
d
00
T`\lyl`10_
```
[Try it online!](https://tio.run/##NYxLDoIwAET37xz1ExemlE/wBF7AZQMtH5UEEBA/ePlaF04mk8nkZaZ6bnrrVtujcRliw8m0JvCSURrGef5r3omKYpUoabK9J2xRdnoYTRAeVBqjK4HYSbH@BxVSek63iz@TuXOWgtLPNWcuXGlo6ei5MTAycWfmwZMXbxY@Xw "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
^
$'
```
Duplicate the input.
```
T`l`111104835__111011062452620`^.
```
Change the first copy to the (first) digit of the relevant result.
```
T`abcm\pq`139285
```
If the number has a multiple of 3 trailing zeros, get that multiple now.
```
\d$
$*0$&$*0$&$*0
```
And actually convert it into the relevant number of trailing zeros. (Note that this would simplify to `*3*0` in Retina 1.)
```
d
00
```
Fix up `d`.
```
T`\lyl`10_
```
Fix up `l` and `y` and remove any remaining letters.
[Answer]
# [PHP](https://php.net/), 104 bytes
```
<?=A<($a='^FX]0483500GC10UL0624526P0'[ord($argn)-97])?20==($b=ord($a)%30)||11==$b?$b:str_pad(1,$b,0):$a;
```
[Try it online!](https://tio.run/##JcrJCsIwFAXQ/f0KkYgNKLzWuTUUEXTjwo0gONFYtU5NTOuI324U3B6OTrS13VD0ug6LRHk5mC6o3q41iIZ9lyYjanr1htccU3mmTPw7Zpfyaqe14KFHQjhMir/zUo34@@26QjAZMulnuVnpKHbcCpMV4j6LArtZJ6pQnKfFwEaQWCPGBlvskGCPA4444YwUChoXGGTIccUNdzzwxOujdL5XaWargy8 "PHP – Try It Online")
I have a string `^FX]0483500GC10UL0624526P0` which holds a single character for every input letter from "a" to "z". I extract this character based on input and store it in `$a`. If the character is not a digit, its ASCII code mod 30 will be stored in `$b`.
If `$a` is a digit, same digit is printed, this is used for any input that needs an output between 0 and 9 (like "e", "f", etc).
Else if `$b` is 20 or 11, same number is printed, this is used for "l" and "y".
Else, digit "1" padded to `$b` with "0"s is printed. For example for input of "a", the character is "^" which has an ASCII code of 94. `94 % 30 = 4` and "1" padded to 4 with "0"s will be "1000".
]