For positive integers gif.latex?a,b,k,l,n, let gif.latex?A_{(k,l)}^{(a,b)}(n) be the set of all integers divisible by gif.latex?a^{k} except gif.latex?a^{k+l}b between gif.latex?1 and gif.latex?n. Under certain condition on these integers, we obtain the explicit formula for gif.latex?\left&space;|A_{(k,l)}^{(a,b)}(n)&space;\right&space;|, where gif.latex?\left&space;|X&space;\right&space;| denotes the number of elements in a finite set gif.latex?X. We also provide bounds on gif.latex?\left&space;|A_{(k,l)}^{(a,b)}(n)&space;\right&space;| and show that these are the best bounds by examples.