The number of ways in which we can arrange the digits 1, 2, 3, …, 9 such that the product of five digits at any of the five consecutive positions is divisible by 7 is
Let an arrangement of 9 digit number be .
Note that we require product of each of is divisible by 7.
This is possible if the 5th digit is 7.
Therefore, we can arrange the 9 digits in desired number of ways in ways.