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.

A335956 a(n) = (2^n - 1)*2^valuation(n, 2) for n > 0 and a(0) = 0.

Original entry on oeis.org

0, 1, 6, 7, 60, 31, 126, 127, 2040, 511, 2046, 2047, 16380, 8191, 32766, 32767, 1048560, 131071, 524286, 524287, 4194300, 2097151, 8388606, 8388607, 134217720, 33554431, 134217726, 134217727, 1073741820, 536870911, 2147483646, 2147483647, 137438953440, 8589934591
Offset: 0

Views

Author

Peter Luschny, Jul 21 2020

Keywords

Examples

			a(4) = (2^4 - 1) * 4 = 15 * 4 = 60.
a(5) = (2^5 - 1) * 1 = 31 * 1 = 31.
		

Crossrefs

Programs

  • Maple
    a := n -> `if`(n=0, 0, (2^n-1)*2^padic[ordp](n, 2)): seq(a(n), n=0..33);
  • Mathematica
    a[0] := 0; a[n_] := (2^n - 1) 2^IntegerExponent[n, 2]; Array[a, 34, 0]
  • PARI
    a(n) = if (n, (2^n - 1)*2^valuation(n, 2), 0); \\ Michel Marcus, Jul 21 2020
    
  • Python
    def A335956(n): return ((1<Chai Wah Wu, Mar 17 2023

Formula

For n > 0, a(n) = A000225(n) * A006519(n). - Antti Karttunen, Jul 21 2020