Step-by-step explanation:
There are 5 different positions of 666:
666////
/666///
//666//
///666/
////666
The forward dashes represent any number from 0 to 9.
Case 1: "666////"
Number of ways = 10⁴ = 10,000.
Case 2: The other positions.
Since the 1st forward dash cannot be 0 (leading digit),
Number of ways for each position = 9 * 10³ = 9,000
Number of ways for all 4 positions = 9,000 * 4 = 36,000.
Total evil numbers = 10,000 + 36,000 = 46,000.