Let the number be x.
Then working backwards, we see that x is less than or equal to 150:
If counted in sevens, nothing will remain, which translates to x = 7p + 0, for
some natural number p.
If counted in sixes, x = 6q+5.
If counted in fives, four will remain. It translates tox = 5r + 4, for some natural
number q.
If counted in fours, three will remain. It translates to x = 4s + 3, for some natural
number s.
If counted in threes, two will remain. It translates to x = 3t + 2, for some natural
number t.
If counted in pairs, one will remain. It translates to x = 2u + 1, for some natural
number u.
That is, in each case, we have x and a positive integer y (in our example,
y takes values 7, 6, 5, 4, 3 and 2, respectively) which divides x and leaves a remainder r (in our case, r is 0, 5, 4, 3, 2 and 1, respectively), that is smaller than y.
Multiples of 7 are 7,14,21….119,126,133….147 (below 150).
119 suitable answer for this.
So answer is 119