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

A384657 Numbers k such that A384655(k) > k.

Original entry on oeis.org

24, 48, 72, 80, 96, 108, 112, 120, 144, 160, 168, 180, 192, 200, 216, 224, 240, 252, 264, 280, 288, 300, 312, 320, 324, 336, 352, 360, 384, 396, 400, 408, 416, 420, 432, 440, 448, 456, 468, 480, 504, 520, 528, 540, 552, 560, 576, 600, 612, 624, 640, 648, 660, 672, 684, 696
Offset: 1

Views

Author

Amiram Eldar, Jun 06 2025

Keywords

Comments

All the terms are nonsquarefree (A013929) since A384655(n) = A051953(n) < n for squarefree numbers n.
If k is a term then any positive multiple of k is also a term (since A384655(m*k) >= m * A384655(k) for any m >= 1). The primitive terms are in A384658.
A384655(36) = 36. Are there any other numbers with this property? There are none below 10^10.
The numbers of terms that do not exceed 10^k, for k = 2, 3, ..., are , 5, 80, 800, 8093, 80201, 803227, 8040424, 80374866, 803561953, ... . Apparently, the asymptotic density of this sequence exists and equals 0.0803... .

Examples

			24 is a term since A384655(24) = 25 > 24.
		

Crossrefs

Subsequence of A013929.
A384658 is a subsequence.

Programs

  • Mathematica
    f[p_, e_, k_] := p^e - If[e < k, 0, p^(e - k)]; q[n_] := Module[{fct = FactorInteger[n], emax, s}, emax = Max[fct[[;; , 2]]]; If[emax < 2, False, s = emax * n; Do[s -= Times @@ (f[#1, #2, k] & @@@ fct), {k, 1, emax}]; s > n]]; Select[Range[700], q]
  • PARI
    isok(m) = {my(f = factor(m), p, e, emax, s); if(issquarefree(f), 0, p = f[,1]; e = f[,2]; emax = vecmax(e); s = emax*m; for(k = 1, emax, s -= prod(i = 1, #p, p[i]^e[i] - if(e[i] < k, 0, p[i]^(e[i]-k)))); s > m);}

A384658 Primitive terms in A384657: numbers k such that A384655(k) > k and A384655(d) <= d for every proper divisor d of k.

Original entry on oeis.org

24, 80, 108, 112, 180, 200, 252, 280, 300, 352, 396, 416, 420, 440, 468, 520, 612, 660, 684, 780, 828, 1044, 1088, 1116, 1216, 1332, 1472, 1476, 1548, 1692, 1856, 1908, 1984, 2124, 2196, 2288, 2412, 2556, 2628, 2844, 2988, 2992, 3204, 3344, 3492, 3536, 3636, 3708, 3852, 3924, 3952
Offset: 1

Views

Author

Amiram Eldar, Jun 06 2025

Keywords

Comments

If k is a term then every positive multiple of k is a term in A384657.

Examples

			24 is a term since A384655(24) = 25 > 24, the proper divisors of 24 are {1, 2, 3, 4, 6, 8, 12}, A384655(1) = 0 < 1, A384655(2) = 1 < 2, A384655(3) = 1 < 3, A384655(4) = 3 < 4, A384655(6) = 4 < 6, A384655(8) = 7 < 8, and A384655(12) = 11 < 12.
		

Crossrefs

Subsequence of A013929 and A384657.
Cf. A384655.

Programs

  • Mathematica
    f[p_, e_, k_] := p^e - If[e < k, 0, p^(e - k)]; q[n_] := Module[{fct = FactorInteger[n], emax, s}, emax = Max[fct[[;; , 2]]]; If[emax < 2, False, s = emax * n; Do[s -= Times @@ (f[#1, #2, k] & @@@ fct), {k, 1, emax}]; s > n]]; primQ[n_] := q[n] && AllTrue[Divisors[n], # == n || !q[#] &]; Select[Range[4000], primQ]
  • PARI
    is1(m) = {my(f = factor(m), p, e, emax, s); if(issquarefree(f), 0, p = f[,1]; e = f[,2]; emax = vecmax(e); s = emax*m; for(k = 1, emax, s -= prod(i = 1, #p, p[i]^e[i] - if(e[i] < k, 0, p[i]^(e[i]-k)))); s > m);}
    isok(k) = if(!is1(k), 0, fordiv(k, d, if(d < k && is1(d), return(0))); 1);

A384659 Numbers k such that A384655(k)/k > A384655(m)/m for all m < k.

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 24, 48, 72, 96, 144, 288, 432, 576, 720, 1440, 2160, 2880, 4320, 8640, 17280, 21600, 25920, 30240, 43200, 60480, 120960, 151200, 181440, 241920, 302400, 604800, 907200, 1209600, 1814400, 3326400, 3628800, 5443200, 6350400, 6652800, 9979200
Offset: 1

Views

Author

Amiram Eldar, Jun 06 2025

Keywords

Comments

All the terms above 2 are nonsquarefree (A013929).

Examples

			The first values of A384655(k)/k, for k = 1..8, are {0, 1/2, 1/3, 3/4, 1/5, 2/3, 1/7, 7/8}. The record values, 0, 1/2, 3/4 and 7/8, occur at k = 1, 2, 4 and 8, the first 4 terms of this sequence.
		

Crossrefs

Subsequence of A025487.

Programs

  • Mathematica
    f[p_, e_, k_] := p^e - If[e < k, 0, p^(e - k)]; r[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/n]; r[1] = 0;
    seq[lim_] := Module[{s = {}, rm = -1, r1}, Do[r1 = r[k]; If[r1 > rm, rm = r1; AppendTo[s, k]], {k, 1, lim}]; s]; seq[10^5]
  • PARI
    r(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/n);
    list(lim) = {my(rm = -1, r1); for(k = 1, lim, r1 = r(k); if(r1 > rm, rm = r1; print1(k, ", ")));}

Formula

Limit_{n->oo} A384655(a(n))/a(n) = c, where c is Niven's constant (A033150).

A384656 a(n) = Sum_{k=1..n} A051903(ugcd(n,k)), where ugcd(n,k) is the greatest divisor of k that is a unitary divisor of n.

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 3, 2, 6, 1, 9, 1, 8, 7, 4, 1, 12, 1, 13, 9, 12, 1, 16, 2, 14, 3, 17, 1, 22, 1, 5, 13, 18, 11, 24, 1, 20, 15, 22, 1, 30, 1, 25, 18, 24, 1, 27, 2, 28, 19, 29, 1, 32, 15, 28, 21, 30, 1, 51, 1, 32, 22, 6, 17, 46, 1, 37, 25, 46, 1, 41, 1, 38, 30
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 of the function f(n, k) is equal to the number of integers i from 1 to n such that the greatest divisor of k that is a unitary divisor of n is 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) = A047994(n), f(n, 2) = A384048(n), and f(n, 3) = A384049(n).
The record values of a(n)/n are 1, 2, 6, 12, 60, 420, ..., i.e, 1, 2, 6, followed by twice the primorials (A088860, A097250) starting from 2*primorial(2) = 2*A002110(2) = 12. The record values of a(n)/n converge to 5/4.

Examples

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

Crossrefs

Programs

  • Mathematica
    f[p_, e_, k_] := p^e - If[e < k, 0, 1]; 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
    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, 1))); 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 - 1 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) >= n - A047994(n) with equality if and only if n is squarefree (A005117).
a(n) >= 2*n - A047994(n) - A384048(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(n) <= A384655(n) with equality if and only if n is squarefree (A005117).
a(n) < 5*n/4 and lim sun_{n->oo} a(n)/n = 5/4.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum{k>=1} (1 - Product_{p prime} (1 - 1/(p^(2*k-1)*(p+1)))) = 0.36292303251495264373... .

A385132 The number of integers k from 1 to n such that gcd(n, k) has an even maximum exponent in its prime factorization.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 5, 7, 4, 10, 7, 12, 6, 8, 11, 16, 8, 18, 13, 12, 10, 22, 11, 21, 12, 20, 19, 28, 8, 30, 21, 20, 16, 24, 24, 36, 18, 24, 21, 40, 12, 42, 31, 29, 22, 46, 25, 43, 22, 32, 37, 52, 22, 40, 31, 36, 28, 58, 31, 60, 30, 43, 43, 48, 20, 66, 49, 44
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Crossrefs

Programs

  • Mathematica
    e[n_] := If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; a[n_] := Sum[Boole[EvenQ[e[GCD[n, k]]]], {k, 1, n}]; 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]]^e[[i]] - If[e[[i]] < k, 0, p[[i]]^(e[[i]]-k)], {i, 1, Length[p]}], {k, 1, kmax}]]; a[1] = 1; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 1, !(vecmax(factor(n)[,2]) % 2));
    a(n) = sum(k = 1, n, q(gcd(n, k)));
    
  • 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, #p, p[i]^e[i] - if(e[i] < k, 0, p[i]^(e[i]-k)))));

Formula

a(n) = Sum_{k=1..n} (1 - A051903(gcd(n, k)) mod 2).
a(n) = n - A385133(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^(k+1) * Product_{i=1..r} f(p_i^e_i, k), 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), kmax(n) = emax(n)+1 if emax(n) is even, and emax(n) otherwise, f(p^e, k) = p^e - p^(e-k) if e >= k, and f(p^e, k) = p^e if e < k.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = 1 - Sum_{k>=1} (-1)^(k+1)*(1-1/zeta(2*k)) = 0.670205512710945303002... .

A385133 The number of integers k from 1 to n such that gcd(n, k) has an odd maximum exponent in its prime factorization.

Original entry on oeis.org

0, 1, 1, 1, 1, 4, 1, 3, 2, 6, 1, 5, 1, 8, 7, 5, 1, 10, 1, 7, 9, 12, 1, 13, 4, 14, 7, 9, 1, 22, 1, 11, 13, 18, 11, 12, 1, 20, 15, 19, 1, 30, 1, 13, 16, 24, 1, 23, 6, 28, 19, 15, 1, 32, 15, 25, 21, 30, 1, 29, 1, 32, 20, 21, 17, 46, 1, 19, 25, 46, 1, 33, 1, 38, 32
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Crossrefs

Programs

  • Mathematica
    e[n_] := If[n == 1, 0, Max[FactorInteger[n][[;; , 2]]]]; a[n_] := Sum[Boole[OddQ[e[GCD[n, k]]]], {k, 1, n}]; 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]]^e[[i]] - If[e[[i]] < k, 0, p[[i]]^(e[[i]]-k)], {i, 1, Length[p]}], {k, 1, kmax}]]; a[1] = 0; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 0, vecmax(factor(n)[,2]) % 2);
    a(n) = sum(k = 1, n, q(gcd(n, k)));
    
  • 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, #p, p[i]^e[i] - if(e[i] < k, 0, p[i]^(e[i]-k)))));

Formula

a(n) = Sum_{k=1..n} (A051903(gcd(n, k)) mod 2).
a(n) = n - A385132(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^k * Product_{i=1..r} f(p_i^e_i, k), 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), kmax(n) = emax(n)+1 if emax(n) is odd, and emax(n) otherwise, f(p^e, k) = p^e - p^(e-k) if e >= k, and f(p^e, k) = p^e if e < k.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{k>=1} (-1)^(k+1)*(1-1/zeta(2*k)) = 0.32979448728905469699... .
Showing 1-6 of 6 results.