cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A220779 Exponent of highest power of 2 dividing the sum 1^n + 2^n + ... + n^n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Jonathan Sondow, Dec 20 2012

Keywords

Comments

2-adic valuation of Sum_{k = 1..n} k^n.
Omitting the zero terms (for n == 1 or 2 mod 4) gives A220780.

Examples

			1^3 + 2^3 + 3^3 = 1 + 8 + 27 = 36 = 2^2 * 9, so a(3) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[ IntegerExponent[ Sum[ k^n, {k, 1, n}], 2], {n, 150}]
  • PARI
    a(n) = valuation(sum(k=1, n, k^n), 2); \\ Michel Marcus, Jul 09 2022
  • Python
    from sympy import harmonic
    def A220779(n): return (~(m:=int(harmonic(n,-n)))&m-1).bit_length() # Chai Wah Wu, Jul 08 2022
    

Formula

a(n) = d - 1 or 2*(d - 1), according as n or n+1 = 2^d * odd, with d > 0.
a(n) = A007814(A031971(n)).
Showing 1-1 of 1 results.