login
A303370
Least integer k such that (k+1)^k >= n.
1
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, 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, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
OFFSET
0,4
COMMENTS
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.
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.
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.
First occurrence of k = 0, 1, 2, ...: 0, 2, 3, 10, 65, 626, 7777, 117650, ... = A124923. - Robert G. Wilson v, Apr 29 2018
LINKS
EXAMPLE
(0+1)^0 = 1 >= 0, therefore a(0) = 0.
(0+1)^0 = 1 >= 1, therefore a(1) = 0.
(0+1)^0 = 1 < 2, but (1+1)^1 = 2 >= 2, therefore a(2) = 1.
(1+1)^1 = 2 < 3, but (2+1)^2 = 9 >= 3, therefore a(n) = 2 for 3 <= n <= 9.
(2+1)^2 = 9 < 10, but (3+1)^3 = 64 >= 10, therefore a(n) = 3 for 10 <= k <= 64.
(3+1)^3 = 64 < 65, but (4+1)^4 = 625 >= 65, therefore a(n) = 4 for 65 <= k <= 625.
MAPLE
A:= Array(0..5^4):
w:= 0:
for k from 0 to 4 do
v:= (k+1)^k;
A[w..v]:= k;
w:= v+1
od:
seq(A[i], i=0..5^4); # Robert Israel, Apr 30 2018
MATHEMATICA
f[n_] := Block[{k = 0}, While[(k + 1)^k < n, k++]; k]; Array[f, 105, 0] (* Robert G. Wilson v, Apr 29 2018 *)
PROG
(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.
CROSSREFS
Sequence in context: A174373 A232270 A191517 * A082528 A055980 A076080
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 26 2018
STATUS
approved