Generation of molecule formula (taken from xscreensaver).