login
Nonzero terms of A220779: exponent of highest power of 2 dividing an even sum 1^n + 2^n + ... + n^n.
2

%I #13 Jul 11 2022 11:27:12

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

%T 4,2,2,1,6,3,2,1,4,2,2,1,8,4,2,1,4,2,2,1,6,3,2,1,4,2,2,1,12,6,2,1,4,2,

%U 2,1,6,3,2,1,4,2,2,1,8,4,2,1,4,2,2,1

%N Nonzero terms of A220779: exponent of highest power of 2 dividing an even sum 1^n + 2^n + ... + n^n.

%C 2-adic valuation of Sum_{k=1..n} k^n for n == 0 or 3 mod 4.

%C See references, links, formulas, and example in A220779.

%t Table[n = 2*k + Mod[k, 2]; IntegerExponent[ Sum[a^n, {a, 1, n}], 2], {k, 150}]

%o (Python)

%o from sympy import harmonic

%o def A220780(n): return (~(m:=int(harmonic(k:=(n<<1)+(n&1),-k)))&m-1).bit_length() # _Chai Wah Wu_, Jul 11 2022

%Y Cf. A001511, A031971, A220779.

%K nonn

%O 1,1

%A _Jonathan Sondow_, Dec 20 2012