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

A116512 a(n) is the number of positive integers each of which is <= n and is divisible by exactly one prime dividing n (but is coprime to every other prime dividing n). a(1) = 0.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Mar 23 2006

Keywords

Comments

a(n) = number of m's, 1 <= m <= n, where gcd(m,n) is a power of a prime (> 1).
We could also have taken a(1) = 1, but a(1) = 0 is better since there are no numbers <= 1 with the desired property. - N. J. A. Sloane, Sep 16 2006

Examples

			12 is divisible by 2 and 3. The positive integers which are <= 12 and which are divisible by 2 or 3, but not by both 2 and 3, are: 2,3,4,8,9,10. Since there are six such integers, a(12) = 6.
		

Crossrefs

Cf. A095112 (Inverse Möbius transform), A354109 (positions of even terms).

Programs

  • Maple
    with(numtheory): a:=proc(n) local c,j: c:=0: for j from 1 to n do if nops(factorset(gcd(j,n)))=1 then c:=c+1 else c:=c: fi od: c; end: seq(a(n),n=1..90); # Emeric Deutsch, Apr 01 2006
  • Mathematica
    Table[Length@Select[GCD[n, Range@n], MatchQ[FactorInteger@#, {{, }}] && # != 1 &], {n, 93}] (* Giovanni Resta, Apr 04 2006; corrected by Ilya Gutkovskiy, Sep 26 2021 *)
    a[n_] := Module[{p = FactorInteger[n][[;; , 1]]}, n * Times @@ (1-1/p) * Total[1/(p-1)]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2025 *)
  • PARI
    { for(n=1,60, hav=0; for(i=1,n, g = gcd(i,n); d = factor(g); dec=matsize(d); if( dec[1] == 1, hav++; ); ); print1(hav,","); ); } \\ R. J. Mathar, Mar 29 2006
    
  • PARI
    a(n) = sumdiv(n, d, eulerphi(n/d) * (isprimepower(d) >= 1)); \\ Daniel Suteu, Jun 27 2018
    
  • PARI
    a(n) = {my(p = factor(n)[,1]); n * vecprod(apply(x -> 1-1/x, p)) * vecsum(apply(x -> 1/(x-1), p));} \\ Amiram Eldar, Jun 21 2025

Formula

Dirichlet g.f.: A(s)*zeta(s-1)/zeta(s) where A(s) is the Dirichlet g.f. for A069513. - Geoffrey Critzer, Feb 22 2015
a(n) = Sum_{d|n, d is a prime power} phi(n/d), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 27 2018
a(n) = phi(n)*Sum_{p|n} 1/(p-1), where p is a prime and phi(k) is the Euler totient function. - Ridouane Oudra, Apr 29 2019
a(n) = Sum_{k=1..n, gcd(n,k) = 1} omega(gcd(n,k-1)). - Ilya Gutkovskiy, Sep 26 2021
a(n) = Sum_{p|n, p prime} p^(v(n,p)-1)*phi(n/p^v(n,p)), where p^v(n,p) is the highest power of p dividing n. - Ridouane Oudra, Oct 06 2023
From Amiram Eldar, Jun 21 2025: (Start)
a(n) = A131233(n) - A000010(n).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{p prime} (1/(p^2-1)) / zeta(2) = A154945 / A013661 = 0.3353893075569103736099... . (End)

Extensions

More terms from R. J. Mathar, Emeric Deutsch and Giovanni Resta, Apr 01 2006
Edited by N. J. A. Sloane, Sep 16 2006

A385199 The number of integers k from 1 to n such that the greatest divisor of k that is either 1 or a prime power (A000961).

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 7, 8, 9, 9, 11, 11, 13, 13, 14, 16, 17, 17, 19, 19, 20, 21, 23, 23, 25, 25, 27, 27, 29, 22, 31, 32, 32, 33, 34, 35, 37, 37, 38, 39, 41, 32, 43, 43, 44, 45, 47, 47, 49, 49, 50, 51, 53, 53, 54, 55, 56, 57, 59, 50, 61, 61, 62, 64, 64, 52, 67, 67
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 either 1 or a prime power, and therefore a(6) = 5.
		

Crossrefs

The unitary analog of A131233.
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), A385197 (noncomposite), A385198 (prime power), this sequence (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[1/f @@@ fct])]; 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~, 1/(f[i,1]^f[i,2] - 1)));}

Formula

The unitary convolution of A047994 (the unitary totient phi) with A010055 (the characteristic function of 1 and prime powers): a(n) = Sum_{d | n, gcd(d, n/d) == 1} A047994(d) * A010055(n/d).
a(n) = uphi(n) * (1 + Sum_{p^e || n} (1/(p^e-1))), where uphi = A047994, and p^e || n denotes that the prime power p^e unitarily divides n (i.e., p^e divides n but p^(e+1) does not divide n).
a(n) = A385198(n) + A047994(n).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = c1 * c2 = 0.96700643911290683406......, c1 = Product_{p prime}(1 - 1/(p*(p+1))) = A065463, and c2 = (1 + Sum_{p prime}(1/(p^2+p-1))) = 1.37272644617447080939... .

A131232 a(n) is the number of positive integers < n that do not have 2 or more distinct prime divisors in common with n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 12, 13, 14, 15, 16, 15, 18, 18, 20, 21, 22, 20, 24, 25, 26, 26, 28, 22, 30, 31, 32, 33, 34, 30, 36, 37, 38, 36, 40, 32, 42, 42, 42, 45, 46, 40, 48, 45, 50, 50, 52, 45, 54, 52, 56, 57, 58, 44, 60, 61, 60, 63, 64, 52, 66, 66, 68, 58, 70, 60, 72
Offset: 1

Views

Author

Leroy Quet, Jun 20 2007

Keywords

Examples

			The distinct primes which divide 20 are 2 and 5. So a(20) is the number of positive integers < 20 which are not divisible by at least 2 distinct primes dividing 20; i.e. are not divisible by both 2 and 5. Among the first 19 positive integers only 10 is divisible by both 2 and 5. There are 18 other positive integers <= 19, so a(20) = 18.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = FactorInteger[n][[;; , 1]]}, n * Times @@ (1-1/p) * (1 + Total[1/(p-1)]) - Boole[Length[p] == 1]]; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jun 21 2025 *)
  • PARI
    a(n) = {my(p = factor(n)[,1]); n * vecprod(apply(x -> 1-1/x, p)) * (1 + vecsum(apply(x -> 1/(x-1), p))) - (#p < 2);} \\ Amiram Eldar, Jun 21 2025

Formula

a(n) = A131233(n) - A010055(n). - Amiram Eldar, Jun 21 2025

Extensions

More terms from Joshua Zucker, Jul 18 2007
Showing 1-3 of 3 results.