Answer
a) 4368
b) 1,118,464
Work Step by Step
a) Hexadecimal string with 1-3 digits = Sum of the number of hexadecimal strings with 1,2,3 digits.
For n digits, we have $16^{n}$ strings, as we can choose every digit can be chosen in 16 ways
for hexadecimal strings of 1-3 = $(16^{1}+16^{2}+16^{3})$ = 16+256+4096 = 4368.
b) Similarly, hexadecimal strings having 2-5 digits =$(16^{2}+16^{3}+16^{4}+16^{5})$
= 256 + 4096 + 65536 + 1048576 = 1,118,464