Not printing the full output

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n1 = sc.nextInt();
int n2 = sc.nextInt();
int n=1;

	for(int i=0; i<n1; i++) {
		if((3*n+2)%n2 != 0) {
			System.out.println((3*n+2));
			n++;
		} else {
			n++;
		}
	}
}

}