login
Positive integer k, 1 <= k <= n, which maximizes k^(n+1-k).
3

%I #21 Jan 09 2023 07:10:48

%S 1,2,2,3,3,3,4,4,4,4,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,

%T 10,10,11,11,11,11,12,12,12,12,12,13,13,13,13,14,14,14,14,14,15,15,15,

%U 15,16,16,16,16,16,17,17,17,17,17,18,18,18,18,18,19,19,19,19,19,20,20,20

%N Positive integer k, 1 <= k <= n, which maximizes k^(n+1-k).

%C a(n) is within 1 of x, where n+1 = x*(1 + log(x)).

%H Seiichi Manyama, <a href="/A056155/b056155.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) ~ e^(LambertW(e*(n + 1)) - 1). - _Mats Granvik_, Jan 26 2017

%e a(5) = 3 because 3^(5+1-3) = 27 is larger than k^(5+1-k) for any other k (1 <= k <= n) besides k = 3.

%t nn = 79; Monitor[a = Table[RankedMax[Table[k^(n + 1 - k), {k, 1, n}], 1], {n, 1, nn}];, n] Monitor[b = Flatten[Table[Position[Table[k^(n + 1 - k), {k, 1, n}], a[[n]]], {n, 1, nn}]], n] (* _Mats Granvik_, Jan 26 2017 *)

%t a[n_] := MaximalBy[Range[n], #^(n + 1 - #)&][[1]];

%t Array[a, 100] (* _Jean-François Alcover_, Dec 11 2020 *)

%o (PARI) a(n) = my(v = vector(n, k, k^(n+1-k))); vecsort(v,,1)[#v]; \\ _Michel Marcus_, Jan 28 2017

%Y Cf. A003320.

%K easy,nonn

%O 1,2

%A _Leroy Quet_, Jul 30 2000