Hi, I was just browsing old questions and ran across yours... the answer is there is no "formula", just systematically working your way through all possibilities. For example, if you asked how many isomers of an alkane C8H18, I would start with a continuous chain of 8 (octane). Then, how can you change it? Shorten the chain and put a branch, longest chain of 7 (heptane) with a methyl group on it. How many places can you put that to end up with different options? (2-heptane, 3-heptane, and 4-heptane are the only options, 5- and 6- are the same as 3- and 2-, and of course if you put the methyl on 1- or 7- it's really an octane!)
Then do a chain of 6 and try all options/combinations for the other 2 carbons. You could do one ethyl group (and how many different places can you put that?) or two methyl groups (and how many different places can you put them?).
Then do shorter chains with any other way to tack on the other carbons (chain of 5 + propyl won't work, you get back to a longer chain! So 5 + ethyl + methyl, give those a try, then see about 5 + three methyls...) And just keep going until you run out of options!
Hope that helps, sorry for the slow reply to your question!