Monday, July 12, 2021

euler686

euler686

this is logarithm problem ~!
I just multiply log10 to A= 2^n

double d = Math.log10(2);  
  
int count =0;  
for(int i=2; i<1000000000; i++){  
    double value  = d* i;  
 double fp = value - (int) value;   
double realValue = Math.pow(10, fp);  
  
 int result = (int)(realValue* 100d);  
 if(result== 123){  
        count++;  
  }  
 
    if(count == 678910){  
        System.out.println(i);  
 break;  }  
}