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.

A345266 a(n) = Sum_{p|n, p prime} gcd(p,n/p).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 2, 2, 1, 4, 1, 3, 2, 2, 1, 3, 5, 2, 3, 3, 1, 3, 1, 2, 2, 2, 2, 5, 1, 2, 2, 3, 1, 3, 1, 3, 4, 2, 1, 3, 7, 6, 2, 3, 1, 4, 2, 3, 2, 2, 1, 4, 1, 2, 4, 2, 2, 3, 1, 3, 2, 3, 1, 5, 1, 2, 6, 3, 2, 3, 1, 3, 3, 2, 1, 4, 2, 2, 2, 3, 1, 5, 2, 3, 2, 2, 2, 3, 1, 8, 4, 7, 1, 3, 1, 3, 3
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 13 2021

Keywords

Examples

			a(18) = Sum_{p|18} gcd(p,18/p) = gcd(2,9) + gcd(3,6) = 1 + 3 = 4.
		

Crossrefs

Cf. A001221 (omega), A007947 (rad), A008472 (sopf), A345302.

Programs

  • Mathematica
    Table[Sum[GCD[k, n/k] (PrimePi[k] - PrimePi[k - 1]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
  • PARI
    a(n) = my(f=factor(n), p); sum(k=1, #f~, p=f[k, 1]; gcd(p,n/p)); \\ Michel Marcus, Jun 16 2021
    
  • PARI
    A345266(n) = vecsum(apply(p->gcd(p,n/p), factor(n)[,1])); \\ Antti Karttunen, Nov 13 2021

Formula

a(p) = 1 for p prime.
From Wesley Ivan Hurt, Nov 21 2021: (Start)
a(n) = A056169(n) + A063958(n).
If n is squarefree, then a(n) = omega(n).
a(p^k) = p for primes p and k >= 2. (End)

Extensions

Data section extended up to 105 terms by Antti Karttunen, Nov 13 2021