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.

A192895 A000120-deficiency of n.

Original entry on oeis.org

-1, 0, -1, 1, -1, 2, -2, 2, 1, 2, -2, 5, -2, 2, 1, 3, -1, 6, -2, 5, 3, 2, -3, 8, 0, 2, 1, 6, -3, 10, -4, 4, 4, 2, 3, 11, -2, 2, 2, 8, -2, 12, -3, 6, 7, 2, -4, 11, 1, 6, 1, 6, -3, 10, 1, 10, 2, 2, -4, 19, -4, 2, 5, 5, 4, 12, -2, 5, 4, 12, -3, 16, -2, 2, 8, 6
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 12 2011

Keywords

Crossrefs

Cf. A257691 (positions where a(n) <= 0), A294905 (and its char.fun).

Programs

  • Haskell
    a192895 n =
       sum (map a000120 $ filter ((== 0) . (mod n)) [1..n-1]) - a000120 n
    a192895_list = map a192895 [1..]
    
  • Mathematica
    a[n_] := DivisorSum[n, Total[IntegerDigits[#, 2]]*(-1)^Boole[# == n]&]; Array[a, 80] (* Jean-François Alcover, Dec 05 2015, adapted from PARI *)
  • PARI
    a(n)=sumdiv(n,d,hammingweight(d)*(-1)^(d==n)) \\ Charles R Greathouse IV, Feb 07 2013
    
  • Python
    from sympy import divisors
    def A192895(n): return sum((d.bit_count() if dChai Wah Wu, Jul 25 2023

Formula

a(n) = Sum(A000120(d): 1 <= d < n and n mod d = 0) - A000120(n); see A175522 for motivation and more information;
a(A175524(n)) < 0; a(A175522(n)) = 0; a(A175526(n)) > 0.
a(n) = A292257(n) - A000120(n). - Antti Karttunen, Nov 10 2017