import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { PrintWriter pw=new PrintWriter(System.out); Scanner sc=new Scanner(System.in); int k=sc.nextInt(); int n=sc.nextInt(); int s=k; int t=k; int len=0; ArrayList isPrime=new ArrayList<>(); isPrime=PrimeList(n); int i=0; while(i=len){ len=j-i+1; memP=isPrime.get(i); } } } pw.println(memP); pw.close(); sc.close(); } public static boolean[] isPrime(int max){//true恧Prime boolean[] p=new boolean[max+1]; Arrays.fill(p, true); p[0]=false; p[1]=false; for(int i=2;i<=max;i++){ if(p[i]==true){ for(int j=2;j*i<=max;j++){ p[j*i]=false; } } } return p; } public static int hash(int n){ int sum=0; while(n>=1){ sum+=n%10; n=(n-n%10)/10; } n=sum; if(n>=10){ return hash(n); }else{ return n; } } public static ArrayList PrimeList(int max){ ArrayList isPrime=new ArrayList<>(); boolean[] p=new boolean[max+1]; p=isPrime(max); for(int i=2;i<=max;i++){ if(p[i]){ isPrime.add(i); } } return isPrime; } }