Function Repository Resource:

FromAtomicNumber

Source Notebook

Find the element for a given atomic number

Contributed by: Wolfram Chemistry Team

ResourceFunction["FromAtomicNumber"][n]

gives the atomic symbol for the element with atomic number n.

Details and Options

For integer inputs, ResourceFunction["FromAtomicNumber"] will return a string or Missing["NotAvailable"].

Examples

Basic Examples (2) 

Find the atomic symbol of the 17th element in the periodic table:

In[1]:=
ResourceFunction["FromAtomicNumber"][17]
Out[1]=

Find the atomic symbol for a list of numbers:

In[2]:=
ResourceFunction["FromAtomicNumber"][{6, 7, 8}]
Out[2]=

Scope (1) 

FromAtomicNumber is typically faster than calling EntityValue for the same information:

In[3]:=
nums = RandomChoice[Range[110], 1000];
In[4]:=
res1 = ResourceFunction["FromAtomicNumber"][nums]; // RepeatedTiming
Out[4]=
In[5]:=
res2 = EntityValue[Entity["Element", #] & /@ nums, "Abbreviation"]; // RepeatedTiming
Out[5]=
In[6]:=
res1 === res2
Out[6]=

Properties and Relations (1) 

The atomic symbols returned by FromAtomicNumber can be used to create "Element" entities directly:

In[7]:=
ResourceFunction["FromAtomicNumber"][Range[11, 15]]
Out[7]=
In[8]:=
Entity["Element", #] & /@ %
Out[8]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 19 April 2019

License Information