799 views
3 votes
For a positive integer n, if the difference between all neighbouring digits are all greater than 3 (e.g. 150),

it is defined as a “good number”. How many three-digit “good number(s)” is/are there?

1 Answer

2 votes

Answer:

  • 166 numbers

Explanation:

Let n = abc is the 3-digit number

b = 0 - 9, total 10 options

  • If b = 0, a= 4 to 9, c = 4 to 9, so 6 options each 6*6 = 36 good numbers
  • If b = 1, a= 5 to 9, c = 5 to 9, so 5 options each 5*5 = 25 good numbers
  • If b = 2, a= 6 to 9, c = 6 to 9, so 4 options each 4*4 = 16 good numbers
  • If b = 3, a= 7 to 9, c = 7 to 9, so 3 options each 3*3 = 9 good numbers
  • If b = 4, a = 8, 9, c = 0, 8, 9, so 2*3 = 6 good numbers
  • If b = 5, a = 1, 9, c = 0, 1, 9, so 2*3 = 6 good numbers
  • If b = 6, a = 1, 2, c = 0, 1, 2, so 2*3 = 6 good numbers
  • If b = 7, a = 1, 2, 3, c = 0, 1,2,3, so 3*4 = 12 good numbers
  • If b = 8, a = 1, 2, 3, 4, c = 0, 1, 2, 3, 4, so 4*5 = 20 good numbers
  • If b = 9, a = 1,2,3,4,5, c = 0, 1, 2, 3, 4, 5, so 5*6 = 30 good numbers

Total good 3-digit numbers:

  • 36 + 25 + 16 + 9 + 6 + 6 + 6 + 12 + 20 + 30 = 166
User Vamsi Krishna DS
by
4.0k points