OFFSET
0,3
COMMENTS
For small values of s, we have Sum_{0 < x < s} x^n ~ (s-1)^n, but for s > n/log(2) + 1.5 (cf. A332101) the difference E(s) = s^n - Sum_{0 < x < s} x^n becomes negative. Just before, the difference has its maximum: We have E(s) < E(s+1) <=> 2*s^n < (s+1)^n <=> s < 1/(2^(1/n)-1), so E takes its maximum at s = A078607(n), the least integer larger than this limiting value. This appears to be almost always equal to A332101(n) - 2.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..367
FORMULA
a(n) = s^n - Sum_{0 < x < s} x^n for s = ceiling(1/(2^(1/n)-1)) = A078607(n).
MAPLE
a:= proc(n) option remember; `if`(n=0, 1, (s->
s^n-add(x^n, x=1..s-1))(ceil(1/(2^(1/n)-1))))
end:
seq(a(n), n=0..20); # Alois P. Heinz, May 09 2020
MATHEMATICA
a[0] = 1; a[n_] := (s = Ceiling[1/(2^(1/n) - 1)])^n - Sum[k^n, {k, 1, s - 1}]; Array[a, 20, 0] (* Amiram Eldar, May 09 2020 *)
PROG
(PARI) {apply( A332097(n, s=1\(sqrtn(2, n-!n)-1))=(s+1)^n-sum(k=1, s, k^n)}, [0..20])
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, May 07 2020
STATUS
approved