Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
for (int i = 2; i < 10000; i++)
{
if (i % n == 2)
System.out.println(i);
}
}
}