How many atoms in the hydrocarbon?
05AB1E, &nbsp;27 26&nbsp; 24 bytes

Saved 1 byte thanks to @KevinCruijssen
Saved 2 bytes thanks to @Grimmy

Note: This code was based on my understanding that only the capitalization of the first letter was customizable. It has since been clarified that it applies to all letters, leading to this significantly shorter answer by Grimmy.

Expects mEpBPhHond for the capitalization of the first letter.

ćC•&gt;·¿*•s÷θD&gt;,₂I3(èH÷+·,


Try it online!

How?

We define the following magic constant:

$$M=1902159854$$

The number of carbon atoms is given by:

$$c=\left(\left\lfloor\frac{M}{n}\right\rfloor\bmod 10\right)+1$$

where \$n\$ is the first character of the input turned into an 05AB1E code point (0-9, A-Z, a-z, ...).

 input |  n  | floor(M/n) | mod 10
-------+-----+------------+--------
 meth- |  48 |   39628330 |   0
 Eth-  |  14 |  135868561 |   1
 prop- |  51 |   37297252 |   2
 But-  |  11 |  172923623 |   3
 Pent- |  25 |   76086394 |   4
 hex-  |  43 |   44236275 |   5
 Hept- |  17 |  111891756 |   6
 oct-  |  50 |   38043197 |   7
 non-  |  49 |   38819588 |   8
 dec-  |  39 |   48773329 |   9


Commented

                         # example input: 'Heptyne'
ć                        # extract the first character -&gt; 'H'
 C                       # turn it into an integer -&gt; 17
  •&gt;·¿*•                 # push the magic constant 1902159854
        s÷               # swap + integer division -&gt; 1902159854 / 17 = 111891756
          θ              # keep the last digit (therefore a modulo 10) -&gt; 6
           D&gt;            # duplicate and increment the copy
             ,           # print the number of carbon atoms
              ₂          # push 26
               I         # push the input string
                3(è      # extract the 3rd to last character -&gt; 'y'
                   H     # parse it as base-36 -&gt; 34
                    ÷    # integer division -&gt; 26 / 34 = 0
                     +   # add to the number of carbon atoms - 1 -&gt; 6
                      ·  # double
                       , # print the number of hydrogen atoms