If the number that starts with firstDigitR and has number of digits = countDigitsR is within the range include the number
if ( getDistinct ( firstDigitR , countDigitsR ) <= R ) : NEW_LINE INDENT count += firstDigitR NEW_LINE DEDENT