Hierarchical clustering methods are generally used when the number of clusters is unknown and explores this number through agglomeration of data. There is a wide choice of measures of distance between clusters, too. So you might use hierarchical clustering first to determine a reasonable number and then use the number with K-means clustering. Unsupervised modeling is not perfect, though.
I might have misunderstood your request, though. If you have a small number of possible numbers, then @jthi's suggestion seems reasonable.
Note, too, that these methods use random initial assignments, so repetitions of the procedure might not produce the exact same cluster assignments, even with the same number of clusters. You could set the random seed, but you can't really say which one is 'correct.'