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.

A297159 a(n) = 3*n - 2*phi(n) - sigma(n); Difference between the deficiency of n and its Moebius-transform.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 0, 1, 6, 5, 1, 1, 3, 1, 2, 7, 10, 1, -4, 4, 12, 5, 4, 1, 2, 1, 1, 11, 16, 9, -7, 1, 18, 13, -2, 1, 6, 1, 8, 9, 22, 1, -12, 6, 17, 17, 10, 1, 6, 13, 0, 19, 28, 1, -20, 1, 30, 13, 1, 15, 14, 1, 14, 23, 18, 1, -27, 1, 36, 21, 16, 15, 18, 1, -10, 14, 40, 1, -20, 19, 42, 29, 4, 1, -12, 17, 20, 31, 46, 21, -28, 1, 39, 21, 3, 1, 26
Offset: 1

Views

Author

Antti Karttunen, Mar 02 2018

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := 3*n - 2*EulerPhi[n] - DivisorSigma[1, n]; Array[a, 100] (* Amiram Eldar, Dec 04 2023 *)
  • PARI
    A297159(n) = (3*n - 2*eulerphi(n) - sigma(n));
    
  • PARI
    A297159(n) = -sumdiv(n,d,(d
    				
  • Python
    from sympy import totient, divisor_sigma
    def a(n): return 3*n-2*totient(n)-divisor_sigma(n)
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Mar 02 2018

Formula

a(n) = A033879(n) - A083254(n) = 3*n - 2*A000010(n) - A000203(n).
a(n) = -Sum_{d|n, dA008683(n/d)*A033879(d).
Sum_{k=1..n} a(k) = (3/2 - 6/Pi^2 - Pi^2/12) * n^2 + O(n*log(n)). - Amiram Eldar, Dec 04 2023