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.

A205745 a(n) = card { d | d*p = n, d odd, p prime }.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 1, 0, 2, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 2, 1, 2, 0, 1, 1, 2, 0, 1, 1, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 1, 1, 2, 0, 2, 1, 1, 0, 1, 1, 2, 0, 2, 1, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 2, 1, 1, 0, 1, 1, 1, 0, 2, 1, 2
Offset: 1

Views

Author

Peter Luschny, Jan 30 2012

Keywords

Comments

Equivalently, a(n) is the number of prime divisors p|n such that n/p is odd. - Gus Wiseman, Jun 06 2018

Crossrefs

Programs

  • Haskell
    a205745 n = sum $ map ((`mod` 2) . (n `div`))
       [p | p <- takeWhile (<= n) a000040_list, n `mod` p == 0]
    -- Reinhard Zumkeller, Jan 31 2012
  • Mathematica
    a[n_] := Sum[ Boole[ OddQ[d] && PrimeQ[n/d] ], {d, Divisors[n]} ]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 27 2013 *)
  • PARI
    a(n)=if(n%2,omega(n),n%4/2) \\ Charles R Greathouse IV, Jan 30 2012
    
  • Sage
    def A205745(n):
        return sum((n//d) % 2 for d in divisors(n) if is_prime(d))
    [A205745(n) for n in (1..105)]
    

Formula

O.g.f.: Sum_{p prime} x^p/(1 - x^(2p)). - Gus Wiseman, Jun 06 2018
Sum_{k=1..n} a(k) = (n/2) * (log(log(n)) + B) + O(n/log(n)), where B is Mertens's constant (A077761). - Amiram Eldar, Sep 21 2024