The number of n digit numbers which consists of the digits 1 and 2 only if each digit is to be used at least once, is equal to 510 then n is______.
(a). 7
(b). 8
(c). 9
(d). 10