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.

A318996 a(n) = Sum_{d|n} (sigma(n) mod d).

Original entry on oeis.org

0, 1, 1, 4, 1, 0, 1, 11, 5, 11, 1, 9, 1, 13, 13, 26, 1, 10, 1, 8, 17, 17, 1, 16, 7, 19, 18, 0, 1, 28, 1, 57, 19, 23, 22, 34, 1, 25, 23, 24, 1, 41, 1, 65, 45, 29, 1, 57, 9, 68, 25, 75, 1, 39, 25, 25, 29, 35, 1, 88, 1, 37, 74, 120, 29, 37, 1, 91, 31, 24, 1, 103
Offset: 1

Views

Author

Jaroslav Krizek, Sep 07 2018

Keywords

Examples

			For n = 4; a(4) = (7 mod 1) + (7 mod 2) + (7 mod 4) = 0 + 1 + 3 = 4.
		

Crossrefs

Programs

  • Magma
    [&+[SumOfDivisors(n) mod d: d in Divisors(n)] : n in [1..1000]]
    
  • Mathematica
    a[n_] := Block[{s = DivisorSigma[1, n]}, DivisorSum[n, Mod[s, #] &]]; Array[a, 72] (* Giovanni Resta, Sep 07 2018 *)
  • PARI
    a(n) = my(sn = sigma(n)); sumdiv(n, d, sn % d); \\ Michel Marcus, Sep 07 2018
    
  • Python
    from sympy import divisors
    def a(n): divs = divisors(n); s = sum(divs); return sum(s%d for d in divs)
    print([a(n) for n in range(1, 73)]) # Michael S. Branicky, Nov 27 2021

Formula

a(A007691(n)) = 0.
a(A000040(n)) = 1.
a(A008578(n)) = tau(n) - 1.
a(n) = n for numbers 4, 45, 6048, 14421, ...