A303370 Least integer k such that (k+1)^k >= n.
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
Keywords
Examples
(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.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
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 *)
-
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.
Comments