In most instances, it's a logical progression of increasing the outer integers. When it comes to trichords, for example, (012) is Forte label 3–1, (013) is 3–2, (014) is 3–3, and so on.
But that's not very helpful with something like (0158); you don't want to walk through all tetrachords to try to determine which one it is, and with tetrachords the algorithm becomes a bit more complex. Really, your best bet is to just have a chart nearby with all of the Forte numbers on them. I know of several music theorists and analysts of twentieth-century music that have such a chart just taped on the wall for easy reference.
And if you'll be spending a lot of time with these, I recommend keeping track of the six set classes that are different based on the Forte and Rahn labeling systems; see more in the table here.
Answer from Richard on Stack Exchangetheory - How do I calculate the Forte number from the Prime form? - Music: Practice & Theory Stack Exchange
theory - Error computing prime form of a pitch class set - Music: Practice & Theory Stack Exchange
Calculate the prime form (Pitch-Class Set Theory)
What is the Prime Form of D F# G Bb B in Set Theory? (Exercise from Robert Hutchinson's "Music Theory for the 21st-Century Classroom")
As the PC Set Calculator you link to shows, [0, 1, 2, 3, 5] is the Prime Inversion of [0, 2, 3, 4, 5]. However, as [0, 1, 2, 3, 5] has a lower interval at the bottom, it is considered the correct prime form of these two equivalent PC Sets.
Another page on the website you link to gives a rigorous method for determining the Prime Form of any PC Set. The last of 8 steps asks you to find:
Which form, the original or the inverted, is most packed to the left (has the smallest numbers)? That will be the Prime Form.
I think you forgot to test inversions -- you should measure the distance between the first two and last two classes, and find the form that packs the smaller intervals to the left.
If you invert [0 2 3 4 5], you get [0 1 2 3 5], which succeeds in packing the shorter distance to the left of the form (starts with a distance of 1 instead of 2).
Has anyone any idea on how to calculate the prime forms of pitch-class sets?
I am aware of the bach objects that deal with set theory, but I am looking for ways to do it more manually.