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.

A320059 Sum of divisors of n^2 that do not divide n.

Original entry on oeis.org

0, 4, 9, 24, 25, 79, 49, 112, 108, 199, 121, 375, 169, 375, 379, 480, 289, 808, 361, 919, 709, 895, 529, 1591, 750, 1239, 1053, 1711, 841, 2749, 961, 1984, 1681, 2095, 1719, 3660, 1369, 2607, 2323, 3847, 1681, 5091, 1849, 4039, 3673, 3799, 2209, 6519, 2744, 5374
Offset: 1

Views

Author

Keywords

Comments

sigma(n^2) is always odd, so this sequence has the opposite parity from sigma(n): even if n is a square or twice a square, odd otherwise.

Crossrefs

Programs

  • Magma
    [DivisorSigma(1, n^2) - DivisorSigma(1, n): n in [1..70]]; // Vincenzo Librandi, Oct 05 2018
    
  • Maple
    map(n -> numtheory:-sigma(n^2)-numtheory:-sigma(n), [$1..100]); # Robert Israel, Oct 04 2018
  • Mathematica
    Table[DivisorSigma[1, n^2] - DivisorSigma[1, n], {n, 70}] (* Vincenzo Librandi, Oct 05 2018 *)
  • PARI
    a(n) = sigma(n^2)-sigma(n)
    
  • Python
    from _future_ import division
    from sympy import factorint
    def A320059(n):
        c1, c2 = 1, 1
        for p, a in factorint(n).items():
            c1 *= (p**(2*a+1)-1)//(p-1)
            c2 *= (p**(a+1)-1)//(p-1)
        return c1-c2 # Chai Wah Wu, Oct 05 2018

Formula

a(n) = sigma(n^2) - sigma(n).
a(n) = A065764(n) - A000203(n).
a(n) = n^2 iff n is prime. - Altug Alkan, Oct 04 2018