Wolfram Language

Generate the Isomers of Decane

There are 75 isomers of decane, with the chemical formula . This example shows how to start with methane and add carbon atoms one by one to exhaustively list all alkanes with up to 10 carbon atoms.

Write a function to take a molecule and replace each unique group with a group, returning the results as a list.

There are two positions in -butane where a carbon atom can be added.

Now add a carbon atom to each of the resulting alkanes. Note this procedure can produce the same molecule from different routes, so delete any duplicates.

Now use this function with Nest to generate all isomers of decane.

Verify that all 75 isomers were found.

Visualize the structure diagrams using ImageCollage.

Related Examples

de es fr ja ko pt-br zh