1 solutions

  • 0
    @ 2025-3-3 16:33:40

    C :

    #include <stdio.h>
    #include <stdlib.h>
    int main()
    {
    	printf("5\n");
    	return 0;
    }
    //Author: ITProgrammer
    

    C++ :

    #include<bits/stdc++.h> 
    using namespace std; 
    
    int main(){ 
    	int i = 5;
    	long long s = 0;
    	int c = 0;
    	while(1==1){
    		s=pow(2,pow(2,i));
    		for(int j = 2;j <= sqrt(s);j++){
    			if(s % j == 0){
    				c++;
    				break;
    			}
    		}
    		if(c != 0){
    			cout<<i;
    			break;	
    		}
    		i++;
    	}
    	return 0;
    } 
    

    Python :

    import math
    import sys
    # x,y=list(map(int,input().split()))
    # n=int(input())
    def zs(n):
        if n==1:
            return 0
        elif n==2:
            return 1
        else:
            for i in range(2,int(n**0.5)+1):
                if n%i ==0:
                    return 0
            return 1
    def hs(i):
        return pow(2,pow(2,i))+1
    i=0
    while zs(hs(i))==1:
        i=i+1
    print(i)
    
    
    • 1

    Information

    ID
    10661
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By