We need to find how many factors of seven all the integers from 1 to 1000 have.
Each integer from 1 to 1000 can be a factor of 7, 49, or 343, giving it 1 factor of 7, 2 factors of 7, or 3 factors of 7.
There are ⌊10007⌋=142 numbers that have 1 factor of 7.
There are ⌊100049⌋=20 numbers that have 2 factors of 7.
There are ⌊1000343⌋=2 numbers that have 3 factors of 7.
So, the answer is 2⋅3+20⋅2+142⋅1.
But, wait!
We are counting numbers that have 2 factors in the numbers that have 1 factor of 7!
And, we are counting numbers that have 3 factors in the numbers that have 2 factors and the numbers that have 1 factor!
So, the answer is 2⋅3+20⋅2+142⋅1−2−2−20=2+20+142=164!