Print Series Question

Hii, Below is the link of my code. All test cases are passed except one. Kindly tell what is the error ?

#include
using namespace std;
int main()
{
signed long int n1,n2,ans=0;
cin>>n1>>n2;

for(int i=1; i<=n1+3; i++)
{
	ans=3*i+2;
	if(ans%n2!=0)
	{
		cout<<ans<<endl;
	}
}
return 0;

}