Numbers can be used as labels to represent items. Barcodes are a perfect example. But if you're sending information to someone who doesn't know what the numbers represent, then you can't communicate. So you'll need a numbering system that will work anywhere, irrespective of the system used.
The periodic table (as an example) could use a linear numbering system to identify individual elements: H=1, He=2, Li=3, Be=4, B=5, C=6, N=7, O=8, F=9, Ne=10, etc.
So if you received information about the number "7" you'd know it was referring to Nitrogen. But a linear system is limited to 1 degree of information, it can only represent the elements, not compounds.
A prime numbering system provides 2 degrees of information. It can represent each element as a prime number: H=2, He=3, Li=5, Be=7, B=11, C=13, N=17, O=19, F=23, Ne=29 etc. It can also represent compounds as composite numbers. For example, the factors of 76 are 2, 2 and 19, which equates to "two Hydrogen plus one Oxygen". So if you received information about the number "76" you would know it was refering to H2O. So a prime number system is an easy way of communicating simple chemical formulas.
Note: This system doesn't communicate information about chemical structure. For example, the number "140608" equates to C3H6, but doesn't explain whether it represents Propene or Cyclopropane. To do so, the numbering system would need to provide additional degrees of information.
The rest of the Elements as prime numbers can be found here
How will the other person know you are sending information about chemical formulas? They might think it is a numbering system for something else.
They'll need to work out for themselves what the numbers represent, but if you provide them with examples, or start off an initial sequence, they should work it out fairly quickly. For example,
3, 29, 61, 151, 251, 443 would represent the noble gases, while
191, 433, 439, 443, etc would represent the "radioactive" elements
Technetium (#191) stands out. It should show the numbering system as representing the period table.
| Compound | Number |
|---|---|
| H2 | 4 |
| LiH | 10 |
| HF | 46 |
| H2O | 76 |
| LiF | 115 |
| HCl | 118 |
| NH3 | 136 |
| LiOH | 190 |
| CH4 | 208 |
| H2S | 212 |
| CO | 247 |
| N2 | 289 |
| LiCl | 295 |
| O2 | 361 |
| F2 | 529 |
| SiH4 | 688 |
| LiBr | 745 |
| LiI | 1205 |
| Li2S | 1325 |
| NaCl | 1829 |
| LiAlH4 | 3280 |
| Cl2 | 3481 |
| KCl | 3953 |
| CO2 | 4693 |
| O3 | 6859 |
| SiO2 | 15523 |
| SO2 | 19133 |
| Br2 | 22201 |
| LiN3 | 24565 |
| LiHCO3 | 891670 |
| Li2CO3 | 2229175 |
| LiC2H3O2 | 2440360 |
| CaCO3 | 6330857 |
| Al2O3 | 11529979 |
| Li2SO4 | 172675325 |