OFFSET
1,5
LINKS
Bui Quang Tuan, Table of n, a(n) for n = 1..1000
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
KEYWORD
nonn
AUTHOR
Bui Quang Tuan, Mar 24 2015
STATUS
approved