A000227test(n,e)= /* ---------------------------------------------------------- PARI program used to search for a value of A000227(n) that might differ from the integer k which maximizes k^(1/k^(1/n)). In principle, in fact, the sequence a(n) = k for which k^(1/k^(1/n)) attains its maximum. might differ from A000227(n) = floor(exp(n)+0.5), even though x=exp(n) is the location of the maximum value of f(x) = x^(1/x^(1/n)). Before calling this function, set real precision to at least the maximum n to be tested (a rule found empirically: rounding problems start at about n = 1.5*precision). Also, set e=exp(1), but only after having set the precision. Typical sequence of PARI/GP commands is: \p 30000 e=exp(1); for(n=2,10000,if(A000227test(n,e)<0,break)) The tested values of n will be printed. Should a discrepancy be found, a message would be printed. Tested empirically, until n=24500 with no mis-match reported (using 30000 digits of precision). It is possible/probable (but not certain) that there is a match for any n, due to the fact that the absolute ratio between third (and higher) and second derivatives at the maximum of f(x) drops rapidly with n: |f'''/f''| is about 6e-2 for n=3, 5e-5 for n=10, and 4e-44 for n=100. Hence, the neighborhood of the maximum becomes rapidly more and more symmetric, making a mismatch between the two sequences less and less probable. Still, this is a heuristic argument, not a rigorous proof. Contributed by Stanislav Sykora, 6 June 2014. ---------------------------------------------------------- */ { my(k,v); k=floor(e^n+0.5); v=k^(1.0/k^(1.0/n)); if(v<(k+1)^(1.0/(k+1)^(1.0/n)), print("No match; max is at A000227(",n,") +1"); return(-1.0)); if(v<(k-1)^(1.0/(k-1)^(1.0/n)), print("No match; max is at A000227(",n,") -1"); return(-1.0)); print(n);return(v); }