So shouldn't it be X^Y(All chars in all places) * 2 (for each permutation add the LF char.) then -1 because the last permutation wouldn't need the LF. It seems you're adding more than necessary with y + 1 (||2) .

Shouldn't it be ((36^8)*2)-1

(a-z+0-9) ^ (length of strings) + number of LF's needed (total permutations(36^8)) - 1 for the last one? This should give the size of a linux dictionary file of all 8 character A-Z 0-9 passwords.

Looking like this: (36 possible chars) * (36 possible chars) * (36 possible chars) * (36 possible chars) * (36 possible chars) * (36 possible chars) * (36 possible chars) * (36 possible chars) = 36^8

Plus the LF for one: (For each permutation add one LF char) = (36^8) *2

Minus the extra char at the end ((36^8)*2)-1

Still not getting your formula. Sorry....

Edit: Did some research and got it. But a really clear explanation would still be cool.