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-8 of 8 results.

A384655 a(n) = Sum_{k=1..n} A051903(gcd(n,k)).

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 4, 6, 1, 11, 1, 8, 7, 15, 1, 14, 1, 17, 9, 12, 1, 25, 6, 14, 13, 23, 1, 22, 1, 31, 13, 18, 11, 36, 1, 20, 15, 39, 1, 30, 1, 35, 26, 24, 1, 53, 8, 32, 19, 41, 1, 44, 15, 53, 21, 30, 1, 59, 1, 32, 34, 63, 17, 46, 1, 53, 25, 46, 1, 81, 1, 38
Offset: 1

Views

Author

Amiram Eldar, Jun 06 2025

Keywords

Comments

The terms of this sequence can be calculated efficiently using the 1st formula. The value the of function f(n, k) is equal to the number of integers i from 1 to n such that gcd(i, n) is 1 if k = 1, or k-free if k >= 2 (k-free numbers are numbers that are not divisible by a k-th power other than 1). E.g., f(n, 1) = A000010(n), f(n, 2) = A063659(n), and f(n, 3) = A254926(n).

Examples

			a(4) = A051903(gcd(4,1)) + A051903(gcd(4,2)) + A051903(gcd(4,3)) + A051903(gcd(4,4)) = A051903(1) + A051903(2) + A051903(1) + A051903(4) = 0 + 1 + 0 + 2 = 3.
		

Crossrefs

Programs

  • Mathematica
    e[n_] := If[n == 1, 0, Max[FactorInteger[n][[;;, 2]]]]; a[n_] := Sum[e[GCD[n, k]], {k, 1, n}]; Array[a, 100]
    (* or *)
    f[p_, e_, k_] := p^e - If[e < k, 0, p^(e - k)]; a[n_] := Module[{fct = FactorInteger[n], emax, s}, emax = Max[fct[[;; , 2]]]; s = emax * n; Do[s -= Times @@ (f[#1, #2, k] & @@@ fct), {k, 1, emax}]; s]; a[1] = 0; Array[a, 100]
  • PARI
    e(n) = if(n == 1, 0, vecmax(factor(n)[,2]));
    a(n) = sum(k = 1, n, e(gcd(n, k)));
    
  • PARI
    a(n) = if(n == 1, 0, my(f = factor(n), p = f[,1], e = f[,2], emax = vecmax(e), s = emax*n); for(k = 1, emax, s -= prod(i = 1, #p, p[i]^e[i] - if(e[i] < k, 0, p[i]^(e[i]-k)))); s);

Formula

a(n) = Sum_{k=1..A051903(n)} (n - f(n, k)) = A051903(n) * n - Sum_{k=1..A051903(n)} f(n, k), where f(n, k) is multiplicative for a given k, with f(p^e, k) = p^e - p^(e-k) if e >= k and f(p^e, k) = p^e if e < k.
a(n) = 1 if and only if n is prime.
a(n) >= 2 if and only if n is composite.
a(n) >= A051953(n) with equality if and only if n is squarefree.
a(n) >= 2*n - A000010(n) - A063659(n) with equality if and only if n is cubefree that is not squarefree (i.e., n in A067259, or equivalently, A051903(n) = 2).
a(p^e) = (p^e-1)/(p-1) for a prime p and e >= 1.
a(n) < c*n and lim sun_{n->oo} a(n)/n = c, where c is Niven's constant (A033150).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum{k>=1} (1-1/zeta(2*k)) = 0.49056393035179738598... .

A383158 a(n) is the denominator of the mean of the maximum exponents in the prime factorizations of the divisors of n.

Original entry on oeis.org

1, 2, 2, 1, 2, 4, 2, 2, 1, 4, 2, 6, 2, 4, 4, 1, 2, 6, 2, 6, 4, 4, 2, 8, 1, 4, 2, 6, 2, 8, 2, 2, 4, 4, 4, 9, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 1, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 4, 2, 4, 6, 1, 4, 8, 2, 6, 4, 8, 2, 6, 2, 4, 6, 6, 4, 8, 2, 10, 1, 4, 2, 4, 4, 4, 4
Offset: 1

Views

Author

Amiram Eldar, Apr 18 2025

Keywords

Comments

a(n) depends only on the prime signature of n (A118914).

Examples

			Fractions begin with 0, 1/2, 1/2, 1, 1/2, 3/4, 1/2, 3/2, 1, 3/4, 1/2, 7/6, ...
4 has 3 divisors: 1, 2 = 2^1 and 4 = 2^2. The maximum exponents in their prime factorizations are 0, 1 and 2, respectively. Therefore, a(4) = denominator((0 + 1 + 2)/3) = denominator(1) = 1.
12 has 6 divisors: 1, 2 = 2^1, 3 = 3^1, 4 = 2^2, 6 = 2 * 3 and 12 = 2^2 * 3. The maximum exponents in their prime factorizations are 0, 1, 1, 2, 1 and 2, respectively. Therefore, a(12) = denominator((0 + 1 + 1 + 2 + 1 + 2)/6) = denominator(7/6) = 6.
		

Crossrefs

Cf. A000005, A051903, A056798, A118914, A383156, A383157 (numerators).

Programs

  • Mathematica
    emax[n_] := If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; a[n_] := Denominator[DivisorSum[n, emax[#] &] / DivisorSigma[0, n]]; Array[a, 100]
  • PARI
    emax(n) = if(n == 1, 0, vecmax(factor(n)[,2]));
    a(n) = my(f = factor(n)); denominator(sumdiv(n, d, emax(d)) / numdiv(f));

Formula

a(n) = denominator(Sum_{d|n} A051903(d) / A000005(n)) = denominator(A383156(n) / A000005(n)).
a(A056798(n)) = 1. a(n) = 1 also for other numbers: 1800, 2700, 3528, ...

A383159 The sum of the maximum exponents in the prime factorizations of the unitary divisors of n.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Apr 18 2025

Keywords

Comments

First differs from A032741 at n = 36, and from A305611 and A325770 at n = 30.
a(n) depends only on the prime signature of n (A118914).

Examples

			4 has 2 unitary divisors: 1 and 4 = 2^2. The maximum exponents in their prime factorizations are 0 and 2, respectively. Therefore, a(4) = 0 + 2 = 2.
12 has 4 divisors: 1, 3 = 3^1, 4 = 2^2 and 12 = 2^2 * 3. The maximum exponents in their prime factorizations are 0, 1, 2 and 2, respectively. Therefore, a(12) = 0 + 1 + 2 + 2 = 5.
		

Crossrefs

Programs

  • Mathematica
    emax[n_] := If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; a[n_] := DivisorSum[n, emax[#] &, CoprimeQ[#, n/#] &]; Array[a, 100]
    (* second program: *)
    a[n_] := If[n == 1, 0, Module[{e = FactorInteger[n][[;; , 2]], emax, v}, emax = Max[e]; v = Table[Times @@ (If[# < k + 1, 2, 1] & /@ e), {k, 1, emax}]; v[[1]] + Sum[k*(v[[k]] - v[[k - 1]]), {k, 2, emax}] - 1]]; Array[a, 100]
  • PARI
    emax(n) = if(n == 1, 0, vecmax(factor(n)[,2]));
    a(n) = sumdiv(n, d, (gcd(d, n/d) == 1) * emax(d));
    
  • PARI
    a(n) = if(n == 1, 0, my(e = factor(n)[, 2], emax = vecmax(e), v); v = vector(emax, k, vecprod(apply(x ->if(x < k+1, 2, 1), e))); v[1] + sum(k = 2, emax, k * (v[k]-v[k-1])) - 1);

Formula

a(n) = Sum_{d|n, gcd(d, n/d) = 1} A051903(d).
a(n) = A034444(n) * A383160(n)/A383161(n).
a(n) <= A383156(n), with equality if and only if n is squarefree (A005117).
a(n) = utau(n, 2) - 1 + Sum_{k=2..A051903(n)} k * (utau(n, k+1) - utau(n, k)), where utau(n, k) is the number of k-free unitary divisors of n (k-free numbers are numbers that are not divisible by a k-th power other than 1). For a given k >= 2, utau(n, k) is a multiplicative function with utau(p^e, k) = 2 if e < k, and 1 otherwise. E.g., utau(n, 2) = A056671(n), utau(n, 3) = A365498(n), and utau(n, 4) = A365499(n).
Sum_{k=1..n} a(k) ~ c_1 * n * log(n) + c_2 * n, where c_1 = c(2) + Sum_{k>=3} (k-1) * (c(k) - c(k-1)) = 0.91974850283445458744..., c(k) = Product_{p prime} (1 - 1/p^2 - 1/p^k + 1/p^(k+1)), c_2 = -1 + (2*gamma - 1)*c_1 + d(2) + Sum_{k>=3} (k-1) * (d(k) - d(k-1)) = -0.50780794945146599739..., d(k) = c(k) * Sum_{p prime} (2*p^(k-1) + k*p - k - 1) * log(p) / (p^(k+1) - p^(k-1) - p + 1), and gamma is Euler's constant (A001620).

A383157 a(n) is the numerator of the mean of the maximum exponents in the prime factorizations of the divisors of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 7, 1, 3, 3, 2, 1, 7, 1, 7, 3, 3, 1, 13, 1, 3, 3, 7, 1, 7, 1, 5, 3, 3, 3, 13, 1, 3, 3, 13, 1, 7, 1, 7, 7, 3, 1, 21, 1, 7, 3, 7, 1, 13, 3, 13, 3, 3, 1, 5, 1, 3, 7, 3, 3, 7, 1, 7, 3, 7, 1, 11, 1, 3, 7, 7, 3, 7, 1, 21, 2, 3, 1, 5, 3
Offset: 1

Views

Author

Amiram Eldar, Apr 18 2025

Keywords

Comments

a(n) depends only on the prime signature of n (A118914).

Examples

			Fractions begin with 0, 1/2, 1/2, 1, 1/2, 3/4, 1/2, 3/2, 1, 3/4, 1/2, 7/6, ...
4 has 3 divisors: 1, 2 = 2^1 and 4 = 2^2. The maximum exponents in their prime factorizations are 0, 1 and 2, respectively. Therefore, a(4) = numerator((0 + 1 + 2)/3) = numerator(1) = 1.
12 has 6 divisors: 1, 2 = 2^1, 3 = 3^1, 4 = 2^2, 6 = 2 * 3 and 12 = 2^2 * 3. The maximum exponents in their prime factorizations are 0, 1, 1, 2, 1 and 2, respectively. Therefore, a(12) = numerator((0 + 1 + 1 + 2 + 1 + 2)/6) = numerator(7/6) = 7.
		

Crossrefs

Programs

  • Mathematica
    emax[n_] := If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; a[n_] := Numerator[DivisorSum[n, emax[#] &] / DivisorSigma[0, n]]; Array[a, 100]
  • PARI
    emax(n) = if(n == 1, 0, vecmax(factor(n)[,2]));
    a(n) = my(f = factor(n)); numerator(sumdiv(n, d, emax(d)) / numdiv(f));

Formula

a(n) = numerator(Sum_{d|n} A051903(d) / A000005(n)) = numerator(A383156(n) / A000005(n)).
a(n)/A383158(n) = 1 if and only if n is a square of a prime (A001248).
Sum_{k=1..n} a(k)/A383158(k) ~ c_1 * n - c_2 * n /sqrt(log(n)), where c_1 = m(2) + Sum_{k>=3} (k-1) * (m(k) - m(k-1)) = 1.27968644485944694957... is the asymptotic mean of the fractions a(k)/A383158(k), m(k) = Product_{p prime} (1 + (1-1/p) * Sum_{i>=k} (k/(i+1) - 1)/p^i is the asymptotic mean of the ratio between the number of k-free divisors and the number of divisors, e.g., m(2) = A308043 and m(3) = A361062, and c_2 = A345231 = 0.54685595528047446684... .

A385128 The number of divisors of n whose maximum exponent in their prime factorization is even.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 2, 1, 2, 3, 1, 1, 1, 3, 1, 1, 1, 6, 1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 5, 2, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 3, 4, 1, 1, 1, 3, 1, 1, 1, 6, 1, 1, 3, 3, 1, 1, 1, 5, 3, 1, 1, 5, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The number of terms in A368714 that divide n.
The sum of these divisors is A385130(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := EvenQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = True; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{e = FactorInteger[n][[;;, 2]], emax, kmax}, emax = Max[e]; kmax = emax + 1 - Mod[emax, 2]; Sum[(-1)^(k+1) * Product[Min[e[[i]], k-1] + 1, {i, 1, Length[e]}], {k, 1, kmax}]]; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 1, !(vecmax(factor(n)[,2]) % 2));
    a(n) = sumdiv(n, d, q(d));
    
  • PARI
    a(n) = if(n == 1, 1, my(e = factor(n)[,2], emax = vecmax(e), kmax = emax + 1 - emax %2); sum(k = 1, kmax, (-1)^(k+1) * prod(i = 1, #e, min(e[i], k-1)+1)));

Formula

a(n) = Sum_{d|n} (1 - A051903(d) mod 2).
a(n) = A000005(n) - A385129(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^(k+1) * Product_{i=1..r} (min(e_i, k-1) + 1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n) if emax(n) is odd, and emax(n)+1 otherwise.
Sum_{k=1..n} a(k) ~ c1 * n * (log(n) + 2*gamma - 1) + c2 * n, where gamma is Euler's constant (A001620), c1 = Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.27591672059822700769..., and c2 = 1 + Sum_{k>=2} (-1)^k * k * zeta'(k)/zeta(k)^2 = 0.56812633046434345687... .

A385129 The number of divisors of n whose maximum exponent in their prime factorization is odd.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The number of divisors of n that are not terms in A368714.
The sum of these divisors is A385131(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := OddQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = False; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{e = FactorInteger[n][[;;, 2]], emax, kmax}, emax = Max[e]; kmax = emax + Mod[emax, 2]; Sum[(-1)^k * Product[Min[e[[i]], k-1] + 1, {i, 1, Length[e]}], {k, 1, kmax}]]; a[1] = 0; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 0, vecmax(factor(n)[,2]) % 2);
    a(n) = sumdiv(n, d, q(d));
    
  • PARI
    a(n) = if(n == 1, 0, my(e = factor(n)[,2], emax = vecmax(e), kmax = emax + emax % 2); sum(k = 1, kmax, (-1)^k * prod(i = 1, #e, min(e[i], k-1)+1)));

Formula

a(n) = Sum_{d|n} (A051903(d) mod 2).
a(n) = A000005(n) - A385128(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^k * Product_{i=1..r} (min(e_i, k-1) + 1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n) if emax(n) is even, and emax(n)+1 otherwise.
Sum_{k=1..n} a(k) ~ c1 * n * (log(n) + 2*gamma - 1) - c2 * n, where gamma is Euler's constant (A001620), c1 = 1 - Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.7240832794017729923099..., and c2 = 1 + Sum_{k>=2} (-1)^k * k * zeta'(k)/zeta(k)^2 = 0.56812633046434345687... .

A385130 The sum of divisors of n whose maximum exponent in their prime factorization is even.

Original entry on oeis.org

1, 1, 1, 5, 1, 1, 1, 5, 10, 1, 1, 17, 1, 1, 1, 21, 1, 28, 1, 25, 1, 1, 1, 17, 26, 1, 10, 33, 1, 1, 1, 21, 1, 1, 1, 80, 1, 1, 1, 25, 1, 1, 1, 49, 55, 1, 1, 81, 50, 76, 1, 57, 1, 28, 1, 33, 1, 1, 1, 97, 1, 1, 73, 85, 1, 1, 1, 73, 1, 1, 1, 80, 1, 1, 101, 81, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The sum of terms in A368714 that divide n.
The number of these divisors is A385128(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := EvenQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = True; a[n_] := DivisorSum[n, # &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{f = FactorInteger[n], p, e, emax, kmax}, p = f[[;;,1]]; e = f[[;;,2]]; emax = Max[e]; kmax = emax + 1 - Mod[emax, 2]; Sum[(-1)^(k+1) * Product[(p[[i]]^(Min[e[[i]], k-1]+1)-1)/(p[[i]]-1), {i, 1, Length[e]}], {k, 1, kmax}]]; a[1] = 1; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 1, !(vecmax(factor(n)[,2]) % 2));
    a(n) = sumdiv(n, d, d*q(d));
    
  • PARI
    a(n) = if(n == 1, 1, my(f = factor(n), p = f[,1], e = f[,2], emax = vecmax(e), kmax = emax + 1 - emax % 2); sum(k = 1, kmax, (-1)^(k+1) * prod(i = 1, #e, (p[i]^(min(e[i], k-1)+1)-1)/(p[i]-1))));

Formula

a(n) = Sum_{d|n} (d * (1 - A051903(d) mod 2)).
a(n) = A000203(n) - A385131(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^(k+1) * Product_{i=1..r} (p_i^(min(e_i, k-1) + 1)-1)/(p_i-1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n) if emax(n) is odd, and emax(n)+1 otherwise.
Sum_{k=1..n} a(k) ~ c * zeta(2) * n^2 / 2, where c = Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.27591672059822700769...,

A385131 The sum of divisors of n whose maximum exponent in their prime factorization is odd.

Original entry on oeis.org

0, 2, 3, 2, 5, 11, 7, 10, 3, 17, 11, 11, 13, 23, 23, 10, 17, 11, 19, 17, 31, 35, 23, 43, 5, 41, 30, 23, 29, 71, 31, 42, 47, 53, 47, 11, 37, 59, 55, 65, 41, 95, 43, 35, 23, 71, 47, 43, 7, 17, 71, 41, 53, 92, 71, 87, 79, 89, 59, 71, 61, 95, 31, 42, 83, 143, 67, 53
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The sum of divisors of n that are not terms in A368714.
The number of these divisors is A385129(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := OddQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = False; a[n_] := DivisorSum[n, # &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{f = FactorInteger[n], p, e, emax, kmax}, p = f[[;;,1]]; e = f[[;;,2]]; emax = Max[e]; kmax = emax + Mod[emax, 2]; Sum[(-1)^k * Product[(p[[i]]^(Min[e[[i]], k-1]+1)-1)/(p[[i]]-1), {i, 1, Length[e]}], {k, 1, kmax}]]; a[1] = 0; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 0, vecmax(factor(n)[,2]) % 2);
    a(n) = sumdiv(n, d, d*q(d));
    
  • PARI
    a(n) = if(n == 1, 0, my(f = factor(n), p = f[,1], e = f[,2], emax = vecmax(e), kmax = emax + emax % 2); sum(k = 1, kmax, (-1)^k * prod(i = 1, #e, (p[i]^(min(e[i], k-1)+1)-1)/(p[i]-1))));

Formula

a(n) = Sum_{d|n} (d * (A051903(d) mod 2)).
a(n) = A000203(n) - A385130(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^k * Product_{i=1..r} (p_i^(min(e_i, k-1) + 1)-1)/(p_i-1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n)+1 if emax(n) is odd, and emax(n) otherwise.
Sum_{k=1..n} a(k) ~ c * zeta(2) * n^2 / 2, where c = 1 - Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.7240832794017729923099...,
Showing 1-8 of 8 results.