This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A303370 #25 May 01 2018 00:08:03 %S A303370 0,0,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, %T A303370 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4, %U A303370 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 %N A303370 Least integer k such that (k+1)^k >= n. %C A303370 n -> a(n+1) is a left inverse for A152917 and also, just like n -> a(n)+1, a left inverse to A000169(n) = n^(n-1), with codomain = the positive integers. %C A303370 a(n+1) is also the smallest m such that n can be written with at most m digits in base m+1. For example, the largest number that can be written with 2 digits in base 3 is 8 = 22[3], to write 9 we need to switch to a(9+1) = 3 digits in base 4. Similarly, 63 is the largest number that can be written with a(63+1) = 3 digits in base 4, and from 64 on we need to go to a(64+1) = 4 digits in base 5. %C A303370 There is no doubt that k must be nonnegative, except for the case n = 0, for which we do not want to consider all negative even k which would also satisfy the inequality, and therefore require k >= 0 to get a well defined solution. %C A303370 First occurrence of k = 0, 1, 2, ...: 0, 2, 3, 10, 65, 626, 7777, 117650, ... = A124923. - _Robert G. Wilson v_, Apr 29 2018 %H A303370 Robert Israel, <a href="/A303370/b303370.txt">Table of n, a(n) for n = 0..10000</a> %e A303370 (0+1)^0 = 1 >= 0, therefore a(0) = 0. %e A303370 (0+1)^0 = 1 >= 1, therefore a(1) = 0. %e A303370 (0+1)^0 = 1 < 2, but (1+1)^1 = 2 >= 2, therefore a(2) = 1. %e A303370 (1+1)^1 = 2 < 3, but (2+1)^2 = 9 >= 3, therefore a(n) = 2 for 3 <= n <= 9. %e A303370 (2+1)^2 = 9 < 10, but (3+1)^3 = 64 >= 10, therefore a(n) = 3 for 10 <= k <= 64. %e A303370 (3+1)^3 = 64 < 65, but (4+1)^4 = 625 >= 65, therefore a(n) = 4 for 65 <= k <= 625. %p A303370 A:= Array(0..5^4): %p A303370 w:= 0: %p A303370 for k from 0 to 4 do %p A303370 v:= (k+1)^k; %p A303370 A[w..v]:= k; %p A303370 w:= v+1 %p A303370 od: %p A303370 seq(A[i],i=0..5^4); # _Robert Israel_, Apr 30 2018 %t A303370 f[n_] := Block[{k = 0}, While[(k + 1)^k < n, k++]; k]; Array[f, 105, 0] (* _Robert G. Wilson v_, Apr 29 2018 *) %o A303370 (PARI) a(n,k=ceil(solve(k=0,log(n+1),(k+1)^k-n)))=k-(k&&k^(k-1)>=n) \\ Corrective term in case ceil() incorrectly rounded up. %Y A303370 Cf. A000169, A152917. %K A303370 nonn %O A303370 0,4 %A A303370 _M. F. Hasler_, Apr 26 2018