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.

A318935 a(n) = Sum_{2^m divides n} 2^(3*m).

Original entry on oeis.org

1, 9, 1, 73, 1, 9, 1, 585, 1, 9, 1, 73, 1, 9, 1, 4681, 1, 9, 1, 73, 1, 9, 1, 585, 1, 9, 1, 73, 1, 9, 1, 37449, 1, 9, 1, 73, 1, 9, 1, 585, 1, 9, 1, 73, 1, 9, 1, 4681, 1, 9, 1, 73, 1, 9, 1, 585, 1, 9, 1, 73, 1, 9, 1, 299593, 1, 9, 1, 73, 1, 9, 1, 585, 1, 9, 1, 73, 1, 9, 1, 4681
Offset: 1

Views

Author

N. J. A. Sloane, Sep 14 2018

Keywords

Comments

Sum of cubes of powers of 2 that divide n.
The high-water marks are (8^m - 1)/7, see A023001.

Crossrefs

Programs

  • Maple
    A007814 := n -> padic[ordp](n, 2):
    T:= n -> add(2^(3*m),m=0..A007814(n));
    [seq(T(n),n=1..100)];
  • Mathematica
    Array[DivisorSum[#, 2^(3 Log2@ #) &, IntegerQ@ Log2@ # &] &, 80] (* or *)
    Array[Total[2^(3 Select[Log2@ Divisors@ #, IntegerQ])] &, 80] (* Michael De Vlieger, Nov 07 2018 *)
    a[n_] := (8^(IntegerExponent[n, 2] + 1) - 1) / 7; Array[a, 100] (* Amiram Eldar, Oct 23 2023 *)
  • PARI
    A318935(n) = { my(s=1,w=8); while(!(n%2), s += w; n /= 2; w *= 8); (s); }; \\ Antti Karttunen, Nov 07 2018
  • Python
    from _future_ import division
    def A318935(n):
        s = bin(n)
        return (8**(len(s)-len(s.rstrip('0'))+1) - 1)//7 # Chai Wah Wu, Sep 14 2018
    

Formula

a(n) = (8^(m+1)-1)/7 where m is the 2-adic valuation of n (A007814). - Chai Wah Wu, Sep 14 2018
Thus multiplicative with a(2^m) = (8^(m+1)-1)/7, and a(p^e) = 1 for odd primes p. - Antti Karttunen, Nov 07 2018
Dirichlet g.f.: zeta(s) / (1 - 1/2^(s-3)). - Amiram Eldar, Oct 23 2023

Extensions

Keyword:mult added by Antti Karttunen, Nov 07 2018