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

A119794 a(n) is the product of the 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) = 1).

Original entry on oeis.org

1, 2, 3, 8, 5, 24, 7, 384, 162, 1920, 11, 17280, 13, 322560, 97200, 10321920, 17, 58060800, 19, 1393459200, 51438240, 40874803200, 23, 536481792000, 375000, 25505877196800, 7142567040, 535623421132800, 29, 439378587648000, 31
Offset: 1

Views

Author

Leroy Quet, Jul 30 2006

Keywords

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. a(12) = the product of these integers, which is 17280.
		

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Select[Range@ n, Function[k, Total@ Boole@ Map[Divisible[k, #] &, FactorInteger[n][[All, 1]]] == 1]], {n, 31}] (* Michael De Vlieger, Oct 01 2017 *)

Extensions

Corrected and extended by Joshua Zucker, Aug 12 2006

A120499 Irregular triangle read by rows in which the n-th row consists of the positive integers which are <= n and divisible by exactly one prime dividing n (but are coprime to every other prime dividing n). (a(1) = 1).

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 2, 3, 4, 7, 2, 4, 6, 8, 3, 6, 9, 2, 4, 5, 6, 8, 11, 2, 3, 4, 8, 9, 10, 13, 2, 4, 6, 7, 8, 10, 12, 3, 5, 6, 9, 10, 12, 2, 4, 6, 8, 10, 12, 14, 16, 17, 2, 3, 4, 8, 9, 10, 14, 15, 16, 19, 2, 4, 5, 6, 8, 12, 14, 15, 16, 18, 3, 6, 7, 9, 12, 14, 15, 18, 2, 4, 6, 8, 10, 11, 12, 14, 16, 18
Offset: 1

Views

Author

Leroy Quet, Aug 06 2006

Keywords

Comments

n-th row of array has A116512(n) terms.

Examples

			12 is divisible by the primes 2 and 3. 2,3,4,8,9,10 are those positive integers which are <= 12, which are divisible by 2 or 3, but are not divisible by 2 and 3. So the 12th row of the array is {2,3,4,8,9,10}.
		

Crossrefs

Programs

  • Mathematica
    Table[Select[Range@ n, Function[k, Total@ Boole@ Map[Divisible[k, #] &, FactorInteger[n][[All, 1]]] == 1]], {n, 22}] // Flatten (* Michael De Vlieger, Sep 30 2017 *)

Extensions

Corrected by Ray Chandler, Aug 29 2006
Showing 1-3 of 3 results.