Problem 172

Investigating numbers with few repeated digits.

How many 18-digit numbers `n` (without leading zeros) are there such that no digit occurs more than three times in `n`?

**
These problems are part of
Project Euler
and are licensed under
CC BY-NC-SA 2.0 UK
**