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.

A362707 a(n) = Sum_{d|n, phi(d)|sigma(d)} (n-d).

Original entry on oeis.org

0, 1, 2, 5, 4, 12, 6, 13, 14, 17, 10, 36, 12, 25, 26, 29, 16, 60, 18, 37, 38, 41, 22, 96, 24, 49, 50, 67, 28, 123, 30, 61, 62, 65, 34, 156, 36, 73, 74, 77, 40, 184, 42, 85, 116, 89, 46, 216, 48, 97, 98, 101, 52, 204, 54, 151, 110, 113, 58, 351, 60, 121, 122, 125, 64, 252, 66, 133
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 30 2023

Keywords

Comments

Total distance from n to each balanced divisor of n (see example).

Examples

			a(12) = 36; 12 has 5 balanced divisors 1,2,3,6,12 and the sum of their distances to n is (12-1)+(12-2)+(12-3)+(12-6)+(12-12) = 36.
		

Crossrefs

Cf. A000005 (tau), A000010 (phi), A020492 (balanced numbers), A351112, A351113, A351114.

Programs

  • Mathematica
    a[n_] := DivisorSum[n, (n - #) &, Divisible[DivisorSigma[1, #], EulerPhi[#]] &]; Array[a, 100]
  • PARI
    a(n) = sumdiv(n, d, if (!(sigma(d) % eulerphi(d)), n-d)); \\ Michel Marcus, Apr 30 2023

Formula

a(n) = Sum_{d|n} (n-d) * A351114(d).
a(n) = n*A351112(n) - A351113(n).