|
|
A220779
|
|
Exponent of highest power of 2 dividing the sum 1^n + 2^n + ... + n^n.
|
|
2
|
|
|
0, 0, 2, 1, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 6, 3, 0, 0, 2, 1, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 8, 4, 0, 0, 2, 1, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 6, 3, 0, 0, 2, 1, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 10, 5, 0, 0, 2, 1, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 6, 3, 0, 0, 2, 1, 0, 0, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
2-adic valuation of Sum_{k = 1..n} k^n.
Omitting the zero terms (for n == 1 or 2 mod 4) gives A220780.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = d - 1 or 2*(d - 1), according as n or n+1 = 2^d * odd, with d > 0.
|
|
EXAMPLE
|
1^3 + 2^3 + 3^3 = 1 + 8 + 27 = 36 = 2^2 * 9, so a(3) = 2.
|
|
MATHEMATICA
|
Table[ IntegerExponent[ Sum[ k^n, {k, 1, n}], 2], {n, 150}]
|
|
PROG
|
(Python)
from sympy import harmonic
def A220779(n): return (~(m:=int(harmonic(n, -n)))&m-1).bit_length() # Chai Wah Wu, Jul 08 2022
(PARI) a(n) = valuation(sum(k=1, n, k^n), 2); \\ Michel Marcus, Jul 09 2022
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|