INTEGER1  Power of Integer
For a given positive integer y(y > 1), if we can find a largest integer k and a smallest positive integer x, such that x^k=y, then the power of y is regarded as k.
Calculate the sum of the power of the integers from a to b. (2<= a <= b <=10^{18})
Input
The input consists of multiple test cases.
For each test case, there is one line containing two integers a and b.
End of input is indicated by a line containing two zeros.
Output
For each test case, output the sum of the power of the integers from a to b.
Example
Input: 2 10 248832 248832 0 0 Output: 13 5
hide comments
DK...:
20191223 02:17:30
Im done with this problem, i tried several ways to solve it, but all of them got WA. Even I used python to avoid overflows, but in the end all my solutions got WA. 

eagle93:
20180709 14:09:13
I don't know why this happened, but the same code gets AC with C++ 4.3.2, but WA with CPP14, really strange!! 

holmesherlock:
20170208 18:45:03
giving me WA over and over..dont know where it is wrong,,tested over different test cases from toolkit,,passed all but still,,,,,,,


Naman Goyal:
20140716 08:32:06
Great problem. You can use long double calculation for finding nth root for initial guess and then correct it with INT 64 verification. For INT 64 verification take care of overflows. 

wisfaq:
20130524 12:04:09
Totally ununderstandable why such a nice and doable problem has so few accepted solutions. Last edit: 20130524 18:48:55 

Harshit Agrawal:
20120910 09:14:38
I am getting WA but could not find any test case for that. what is the answer for a=2 and b=1000000000000000000 ?


(Tjandra Satria Gunawan)(æ›¾æ¯…æ˜†):
20120902 11:19:07
use double > TLE


cprocoder:
20110713 11:52:18
Really very nice problem 

sandeep pandey:
20110409 19:33:39
Really nice problem.


P != NP:
20100330 18:07:02
don't use doubles or long doubles for this question....it will give WA. Use only long long int. Last edit: 20100330 18:07:44 
Added by:  Fudan University Problem Setters 
Date:  20090523 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: C99 ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  Fudan University Local Contest #1 