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.

Showing 1-4 of 4 results.

A117494 a(n) is the number of m's, 1 <= m <= n, where gcd(m,n) is prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 2, 2, 5, 1, 4, 1, 7, 6, 4, 1, 8, 1, 6, 8, 11, 1, 8, 4, 13, 6, 8, 1, 14, 1, 8, 12, 17, 10, 10, 1, 19, 14, 12, 1, 20, 1, 12, 14, 23, 1, 16, 6, 24, 18, 14, 1, 24, 14, 16, 20, 29, 1, 20, 1, 31, 18, 16, 16, 32, 1, 18, 24, 34, 1, 20, 1, 37, 28, 20, 16, 38, 1, 24, 18, 41, 1, 28
Offset: 1

Views

Author

Leroy Quet, Mar 22 2006

Keywords

Comments

Dirichlet convolution of A000010 (Euler phi) and A010051 (characteristic function of primes), therefore also Möbius transform of A069359. - Antti Karttunen, Nov 17 2021

Examples

			Of the positive integers <= 12, exactly four (2, 3, 9 and 10) have a GCD with 12 that is prime. (gcd(2,12) = 2, gcd(3,12) = 3, gcd(9,12) = 3, gcd(10,12) = 2.)
So a(12) = 4.
		

Crossrefs

Coincides with A300251 on squarefree numbers, A005117.

Programs

  • Maple
    a:=proc(n) local c,m: c:=0: for m from 1 to n do if isprime(gcd(m,n))=true then c:=c+1 else c:=c fi od: end: seq(a(n),n=1..100); # Emeric Deutsch, Apr 01 2006
  • Mathematica
    f[n_] := Length@ Select[GCD[n, Range@n], PrimeQ@ # &]; Array[f, 84] (* Robert G. Wilson v, Apr 06 2006 *)
    Table[Count[Range@ n, ?(PrimeQ@ GCD[#, n] &)], {n, 84}] (* _Michael De Vlieger, Feb 25 2018 *)
    a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; n * Times @@ (1-1/p) * Total[1/(p - (Boole[# == 1] & /@ e))]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2025 *)
  • PARI
    A117494(n) = sum(k=1,n,isprime(gcd(n,k))); \\ Antti Karttunen, Feb 25 2018
    
  • PARI
    a(n) = my(f=factor(n)[, 1]); sum(k=1, #f, eulerphi(n/f[k])); \\ Daniel Suteu, Jun 23 2018
    
  • PARI
    A117494(n) = sumdiv(n,d,eulerphi(n/d)*isprime(d)); \\ Antti Karttunen, Nov 17 2021

Formula

Dirichlet g.f: P(s)*Z(s-1)/Z(s) with P(s) the prime zeta function and Z(s) the Riemann zeta function. - Pierre-Louis Giscard, Jul 16 2014
a(n) = Sum_{distinct primes p dividing n} phi(n/p), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 23 2018
From Antti Karttunen, Nov 17 2021: (Start)
a(n) = Sum_{d|n} A008683(n/d) * A069359(d).
a(n) = Sum_{d|n} A000010(n/d) * A010051(d).
a(n) = A349338(n) - A000010(n).
a(A005117(n)) = A300251(A005117(n)) for all n >= 1. (End)
a(n) = 1 iff n = 4 or n is prime (A175787). - Bernard Schott, Nov 18 2021
Sum_{k=1..n} a(k) ~ 3 * A085548 * n^2 / Pi^2. - Vaclav Kotesovec, Nov 20 2021

Extensions

More terms from Emeric Deutsch, Apr 01 2006

A349434 Dirichlet convolution of A129283 (n + its arithmetic derivative) with A349337 (Dirichlet inverse of A230593).

Original entry on oeis.org

1, 0, 0, 2, 0, 0, 0, 2, 3, 0, 0, -2, 0, 0, 0, 6, 0, -3, 0, -2, 0, 0, 0, 0, 5, 0, 6, -2, 0, 0, 0, 10, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, -2, -3, 0, 0, -6, 7, -5, 0, -2, 0, -3, 0, 0, 0, 0, 0, 4, 0, 0, -3, 22, 0, 0, 0, -2, 0, 0, 0, -5, 0, 0, -5, -2, 0, 0, 0, -6, 21, 0, 0, 4, 0, 0, 0, 0, 0, 6, 0, -2, 0, 0, 0, -4, 0, -7, -3, 7
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Comments

Dirichlet convolution of this sequence with A349338 is A348976.

Crossrefs

Cf. A003415, A129283, A230593, A349337, A349435 (Dirichlet inverse), A349436 (sum with it).
Cf. also A348976, A349338.

Programs

  • Mathematica
    s[n_] := n * DivisorSum[n, 1/# &, !CompositeQ[#] &]; sinv[1] = 1; sinv[n_] := sinv[n] = -DivisorSum[n, sinv[#] * s[n/#] &, # < n &]; f[p_, e_] := e/p; d[1] = 1; d[n_] := n*(1 + Plus @@ f @@@ FactorInteger[n]); a[n_] := DivisorSum[n, sinv[#] * d[n/#] &]; Array[a, 100] (* Amiram Eldar, Nov 18 2021 *)
  • PARI
    up_to = 20000;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
    A129283(n) = (n+A003415(n));
    A230593(n) = sumdiv(n, d, ((1==d)||isprime(d))*(n/d));
    v349337 = DirInverseCorrect(vector(up_to,n,A230593(n)));
    A349337(n) = v349337[n];
    A349434(n) = sumdiv(n,d,A129283(n/d)*A349337(d));

Formula

a(n) = Sum_{d|n} A129283(n/d) * A349337(d).

A349435 Dirichlet convolution of A230593 with A347084, which is Dirichlet inverse of {n + its arithmetic derivative}.

Original entry on oeis.org

1, 0, 0, -2, 0, 0, 0, -2, -3, 0, 0, 2, 0, 0, 0, -2, 0, 3, 0, 2, 0, 0, 0, 0, -5, 0, -6, 2, 0, 0, 0, -2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, -2, -7, 5, 0, 2, 0, 3, 0, 0, 0, 0, 0, -4, 0, 0, 3, -2, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 5, 2, 0, 0, 0, -2, -12, 0, 0, -4, 0, 0, 0, 0, 0, -6, 0, 2, 0, 0, 0, -4, 0, 7, 3
Offset: 1

Views

Author

Antti Karttunen, Nov 17 2021

Keywords

Comments

Dirichlet convolution of this sequence with A348976 is A349338.
The positions of records start as: 1, 12, 18, 36, 100, 108, 196, 225, 324, 441, 500, 1125, 1372, 2500, 5000, 5324, 8575, 8788, 9604, 12500, 19652, etc.

Crossrefs

Cf. A003415, A129283, A230593, A347084, A349434 (Dirichlet inverse), A349436 (sum with it).
Cf. also A348976, A349338.

Programs

  • Mathematica
    s[n_] := n * DivisorSum[n, 1/# &, !CompositeQ[#] &]; f[p_, e_] := e/p; d[1] = 1; d[n_] := n*(1 + Plus @@ f @@@ FactorInteger[n]); dinv[1] = 1; dinv[n_] := dinv[n] = -DivisorSum[n, dinv[#] * d[n/#] &, # < n &]; a[n_] := DivisorSum[n, s[#] * dinv[n/#] &]; Array[a, 100] (* Amiram Eldar, Nov 18 2021 *)
  • PARI
    up_to = 20000;
    DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1]*sumdiv(n, d, if(dA003415(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]/f[i, 1]));
    A230593(n) = sumdiv(n, d, ((1==d)||isprime(d))*(n/d));
    v347084 = DirInverseCorrect(vector(up_to,n,n+A003415(n)));
    A347084(n) = v347084[n];
    A349435(n) = sumdiv(n,d,A230593(n/d)*A347084(d));

Formula

a(n) = Sum_{d|n} A230593(n/d) * A347084(d).

A385197 The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is a noncomposite number.

Original entry on oeis.org

1, 2, 3, 3, 5, 5, 7, 7, 8, 9, 11, 9, 13, 13, 14, 15, 17, 16, 19, 15, 20, 21, 23, 21, 24, 25, 26, 21, 29, 22, 31, 31, 32, 33, 34, 24, 37, 37, 38, 35, 41, 32, 43, 33, 40, 45, 47, 45, 48, 48, 50, 39, 53, 52, 54, 49, 56, 57, 59, 42, 61, 61, 56, 63, 64, 52, 67, 51
Offset: 1

Views

Author

Amiram Eldar, Jun 21 2025

Keywords

Examples

			For n = 6, the greatest divisor of k that is a unitary divisor of 6 for k = 1 to 6 is 1, 2, 3, 2, 1 and 6, respectively. 5 of the values are noncomposite numbers, and therefore a(6) = 5.
		

Crossrefs

The unitary analog of A349338.
The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is: A047994 (1), A384048 (squarefree), A384049 (cubefree), A384050 (powerful), A384051 (cubefull), A384052 (square), A384053 (cube), A384054 (exponentially odd), A384055 (odd), A384056 (power of 2), A384057 (3-smooth), A384058 (5-rough), A385195 (1 or 2), A385196 (prime), this sequence (noncomposite), A385198 (prime power), A385199 (1 or prime power).

Programs

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

Formula

The unitary convolution of A047994 (the unitary totient phi) with A080339 (the characteristic function of noncomposite numbers): a(n) = Sum_{d | n, gcd(d, n/d) == 1} A047994(d) * A080339(n/d).
a(n) = uphi(n) * (1 + Sum_{p || n} (1/(p-1))), where uphi = A047994, and p || n denotes that p unitarily divides n (i.e., the p-adic valuation of n is 1).
a(n) = A385196(n) + A047994(n).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = c1 * c2 = 0.92334965064835578762..., c1 = Product_{p prime}(1 - 1/(p*(p+1))) = A065463, and c2 = 1 + Sum_{p prime}((p^2-1)/(p^2*(p^2+p-1))) = 1.31075288978811405615... .
Showing 1-4 of 4 results.