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.

A384039 The number of integers k from 1 to n such that gcd(n,k) is a powerful number.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 6, 7, 4, 10, 6, 12, 6, 8, 12, 16, 7, 18, 12, 12, 10, 22, 12, 21, 12, 21, 18, 28, 8, 30, 24, 20, 16, 24, 21, 36, 18, 24, 24, 40, 12, 42, 30, 28, 22, 46, 24, 43, 21, 32, 36, 52, 21, 40, 36, 36, 28, 58, 24, 60, 30, 42, 48, 48, 20, 66, 48, 44
Offset: 1

Views

Author

Amiram Eldar, May 18 2025

Keywords

Comments

The number of integers k from 1 to n such that the powerfree part (A055231) of gcd(n,k) is 1.

Crossrefs

The number of integers k from 1 to n such that gcd(n,k) is: A026741 (odd), A062570 (power of 2), A063659 (squarefree), A078429 (cube), A116512 (power of a prime), A117494 (prime), A126246 (1 or 2), A206369 (square), A254926 (cubefree), A372671 (3-smooth), this sequence (powerful), A384040 (cubefull), A384041 (exponentially odd), A384042 (5-rough).

Programs

  • Mathematica
    f[p_, e_] := If[e == 1, p-1, (p^2-p+1)*p^(e-2)]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,2] == 1, f[i,1]-1, (f[i,1]^2-f[i,1]+1)*f[i,1]^(f[i,2]-2)));}

Formula

Multiplicative with a(p^e) = (p^2-p+1)*p^(e-2) if e >= 2, and p-1 otherwise.
a(n) >= A000010(n), with equality if and only if n is squarefree (A005117).
Dirichlet g.f.: zeta(s-1) * Product_{p prime} (1 - 1/p^s + 1/p^(2*s)).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{p prime} (1 - 1/p^2 + 1/p^4) = 0.66922021803510257394... .