Let T be a rooted tree with branches T 1 , T 2 , . . . , T r and p m the m-th prime number (p 1 = 2, p 2 = 3, p 3 = 5, . . .). The Matula number M (T ) of T is p M (T1) •p M (T2) •. . .• p M (Tr) , starting with M (•) = 1. It was put forward half a century ago by the American mathematician David Matula. In this paper, we prove that the star (consisting of a root and leaves attached to it) and the binary caterpillar (a binary tree whose internal vertices form a path starting at the root) have the smallest and greatest Matula number, respectively, over all topological trees (rooted trees without vertices of outdegree 1) with a prescribed number of leaves -the extremal values are also derived.