login
A253188
Minimal positive integer k such that n^n >= (n-k)^(n+k).
1
1, 1, 1, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59
OFFSET
1,5
LINKS
EXAMPLE
a(4) = 1 because 4^4 = 256 > 243 = (4-1)^(4+1).
a(5) = 2 because 5^5 = 3125 > 2187 = (5-2)^(5+2) (but < 4096 = (5-1)^(5+1)).
MATHEMATICA
f[n_] := Block[{k = 1}, While[n^n < (n - k)^(n + k), k++]; k]; Array[f, 120] (* Michael De Vlieger, Mar 24 2015 *)
PROG
(PARI) a(n) = {k = 1; npn = n^n; while(npn < (n-k)^(n+k), k++); k; } \\ Michel Marcus, Mar 24 2015
CROSSREFS
Sequence in context: A362949 A056847 A268234 * A320847 A105598 A356991
KEYWORD
nonn
AUTHOR
Bui Quang Tuan, Mar 24 2015
STATUS
approved