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.

A362469 Sum of the numbers k, 1 <= k <= n, such that phi(k) | n.

Original entry on oeis.org

1, 3, 3, 10, 3, 16, 3, 29, 3, 16, 3, 67, 3, 16, 3, 82, 3, 64, 3, 62, 3, 16, 3, 208, 3, 16, 3, 51, 3, 97, 3, 205, 3, 16, 3, 269, 3, 16, 3, 247, 3, 64, 3, 74, 3, 16, 3, 660, 3, 49, 3, 51, 3, 202, 3, 185, 3, 16, 3, 481, 3, 16, 3, 502, 3, 133, 3, 51, 3, 49, 3, 1034, 3, 16, 3, 51, 3
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 21 2023

Keywords

Examples

			a(4) = 10: for the numbers 1..4, phi(1)=1|4, phi(2)=1|4, phi(3)=2|4, and phi(4)=2|4. Their sum is then 1+2+3+4 = 10.
		

Crossrefs

Row sums of A378636.

Programs

  • Mathematica
    a[n_] := Sum[If[Divisible[n, EulerPhi[k]], k, 0], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Apr 22 2023 *)
  • PARI
    a(n) = sum(k=1, n, if (!(n % eulerphi(k)), k)); \\ Michel Marcus, Apr 22 2023

Formula

a(n) = Sum_{k=1..n} k * (1 - ceiling(n/phi(k)) + floor(n/phi(k))).