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.

A000720 pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Partial sums of A010051 (characteristic function of primes). - Jeremy Gardiner, Aug 13 2002
pi(n) and prime(n) are inverse functions: a(A000040(n)) = n and A000040(n) is the least number m such that A000040(a(m)) = A000040(n). A000040(a(n)) = n if (and only if) n is prime. - Jonathan Sondow, Dec 27 2004
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
A lower bound that gets better with larger N is that there are at least T prime numbers less than N, where the recursive function T is: T = N - N*Sum_{i=0..T(sqrt(N))} A005867(i)/A002110(i). - Ben Paul Thurston, Aug 23 2010
Number of partitions of 2n into exactly two parts with the smallest part prime. - Wesley Ivan Hurt, Jul 20 2013
Equivalent to the Riemann hypothesis: abs(a(n) - li(n)) < sqrt(n)*log(n)/(8*Pi), for n >= 2657, where li(n) is the logarithmic integral (Lowell Schoenfeld). - Ilya Gutkovskiy, Jul 05 2016
The second Hardy-Littlewood conjecture, that pi(x) + pi(y) >= pi(x + y) for integers x and y with min{x, y} >= 2, is known to hold for (x, y) sufficiently large (Udrescu 1975). - Peter Luschny, Jan 12 2021

Examples

			There are 3 primes <= 6, namely 2, 3 and 5, so pi(6) = 3.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 129.
  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 409.
  • Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 5.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorems 6, 7, 420.
  • G. J. O. Jameson, The Prime Number Theorem, Camb. Univ. Press, 2003. [See also the review by D. M. Bressoud (link below).]
  • Władysław Narkiewicz, The Development of Prime Number Theory, Springer-Verlag, 2000.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 132-133, 157-184.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.1. (For inequalities, etc.).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Gerald Tenenbaum and Michel Mendès France, Prime Numbers and Their Distribution, AMS Providence RI, 1999.
  • V. Udrescu, Some remarks concerning the conjecture pi(x + y) <= pi(x) + pi(y), Rev. Roumaine Math. Pures Appl. 20 (1975), 1201-1208.

Crossrefs

Closely related:
A099802: Number of primes <= 2n.
A060715: Number of primes between n and 2n (exclusive).
A035250: Number of primes between n and 2n (inclusive).
A038107: Number of primes < n^2.
A014085: Number of primes between n^2 and (n+1)^2.
A007053: Number of primes <= 2^n.
A036378: Number of primes p between powers of 2, 2^n < p <= 2^(n+1).
A006880: Number of primes < 10^n.
A006879: Number of primes with n digits.
A033270: Number of odd primes <= n.
A065855: Number of composites <= n.
For lists of large values of a(n) see, e.g., A005669(n) = a(A002386(n)), A214935(n) = a(A205827(n)).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

  • Haskell
    a000720 n = a000720_list !! (n-1)
    a000720_list = scanl1 (+) a010051_list  -- Reinhard Zumkeller, Sep 15 2011
    
  • Magma
    [ #PrimesUpTo(n): n in [1..200] ];  // Bruno Berselli, Jul 06 2011
    
  • Maple
    with(numtheory); A000720 := pi; [ seq(A000720(i),i=1..50) ];
  • Mathematica
    A000720[n_] := PrimePi[n]; Table[ A000720[n], {n, 1, 100} ]
    Array[ PrimePi[ # ]&, 100 ]
    Accumulate[Table[Boole[PrimeQ[n]],{n,100}]] (* Harvey P. Dale, Jan 17 2015 *)
  • PARI
    A000720=vector(100,n,omega(n!)) \\ For illustration only; better use A000720=primepi
    
  • PARI
    vector(300,j,primepi(j)) \\ Joerg Arndt, May 09 2008
    
  • Python
    from sympy import primepi
    for n in range(1,100): print(primepi(n), end=', ') # Stefano Spezia, Nov 30 2018
  • Sage
    [prime_pi(n) for n in range(1, 79)]  # Zerinvary Lajos, Jun 06 2009
    

Formula

The prime number theorem gives the asymptotic expression a(n) ~ n/log(n).
For x > 1, pi(x) < (x / log x) * (1 + 3/(2 log x)). For x >= 59, pi(x) > (x / log x) * (1 + 1/(2 log x)). [Rosser and Schoenfeld]
For x >= 355991, pi(x) < (x / log(x)) * (1 + 1/log(x) + 2.51/(log(x))^2 ). For x >= 599, pi(x) > (x / log(x)) * (1 + 1/log(x)). [Dusart]
For x >= 55, x/(log(x) + 2) < pi(x) < x/(log(x) - 4). [Rosser]
For n > 1, A138194(n) <= a(n) <= A138195(n) (Tschebyscheff, 1850). - Reinhard Zumkeller, Mar 04 2008
For n >= 33, a(n) = 1 + Sum_{j=3..n} ((j-2)! - j*floor((j-2)!/j)) (Hardy and Wright); for n >= 1, a(n) = n - 1 + Sum_{j=2..n} (floor((2 - Sum_{i=1..j} (floor(j/i)-floor((j-1)/i)))/j)) (Ruiz and Sondow 2000). - Benoit Cloitre, Aug 31 2003
a(n) = A001221(A000142(n)). - Benoit Cloitre, Jun 03 2005
G.f.: Sum_{p prime} x^p/(1-x) = b(x)/(1-x), where b(x) is the g.f. for A010051. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = A036234(n) - 1. - Jaroslav Krizek, Mar 23 2009
From Enrique Pérez Herrero, Jul 12 2010: (Start)
a(n) = Sum_{i=2..n} floor((i+1)/A000203(i)).
a(n) = Sum_{i=2..n} floor(A000010(n)/(i-1)).
a(n) = Sum_{i=2..n} floor(2/A000005(n)). (End)
Let pf(n) denote the set of prime factors of an integer n. Then a(n) = card(pf(n!/floor(n/2)!)). - Peter Luschny, Mar 13 2011
a(n) = -Sum_{p <= n} mu(p). - Wesley Ivan Hurt, Jan 04 2013
a(n) = (1/2)*Sum_{p <= n} (mu(p)*d(p)*sigma(p)*phi(p)) + sum_{p <= n} p^2. - Wesley Ivan Hurt, Jan 04 2013
a(1) = 0 and then, for all k >= 1, repeat k A001223(k) times. - Jean-Christophe Hervé, Oct 29 2013
a(n) = n/(log(n) - 1 - Sum_{k=1..m} A233824(k)/log(n)^k + O(1/log(n)^{m+1})) for m > 0. - Jonathan Sondow, Dec 19 2013
a(n) = A001221(A003418(n)). - Eric Desbiaux, May 01 2014
a(n) = Sum_{j=2..n} H(-sin^2 (Pi*(Gamma(j)+1)/j)) where H(x) is the Heaviside step function, taking H(0)=1. - Keshav Raghavan, Jun 18 2016
a(A014076(n)) = (1/2) * (A014076(n) + 1) - n + 1. - Christopher Heiling, Mar 03 2017
From Steven Foster Clark, Sep 25 2018: (Start)
a(n) = Sum_{m=1..n} A143519(m) * floor(n/m).
a(n) = Sum_{m=1..n} A001221(m) * A002321(floor(n/m)) where A002321() is the Mertens function.
a(n) = Sum_{m=1..n} |A143519(m)| * A002819(floor(n/m)) where A002819() is the Liouville Lambda summatory function and |x| is the absolute value of x.
a(n) = Sum_{m=1..n} A137851(m)/m * H(floor(n/m)) where H(n) = Sum_{m=1..n} 1/m is the harmonic number function.
a(n) = Sum_{m=1..log_2(n)} A008683(m) * A025528(floor(n^(1/m))) where A008683() is the Moebius mu function and A025528() is the prime-power counting function.
(End)
Sum_{k=2..n} 1/a(k) ~ (1/2) * log(n)^2 + O(log(n)) (de Koninck and Ivić, 1980). - Amiram Eldar, Mar 08 2021
a(n) ~ 1/(n^(1/n)-1). - Thomas Ordowski, Jan 30 2023
a(n) = Sum_{j=2..n} floor(((j - 1)! + 1)/j - floor((j - 1)!/j)) [Mináč, unpublished] (see Ribenboim, pp. 132-133). - Stefano Spezia, Apr 13 2025
a(n) = n - 1 - Sum_{k=2..floor(log_2(n))} pi_k(n), where pi_k(n) is the number of k-almost primes <= n. - Daniel Suteu, Aug 27 2025

Extensions

Additional links contributed by Lekraj Beedassy, Dec 23 2003
Edited by M. F. Hasler, Apr 27 2018 and (links recovered) Dec 21 2018

A025487 Least integer of each prime signature A124832; also products of primorial numbers A002110.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 16, 24, 30, 32, 36, 48, 60, 64, 72, 96, 120, 128, 144, 180, 192, 210, 216, 240, 256, 288, 360, 384, 420, 432, 480, 512, 576, 720, 768, 840, 864, 900, 960, 1024, 1080, 1152, 1260, 1296, 1440, 1536, 1680, 1728, 1800, 1920, 2048, 2160, 2304, 2310
Offset: 1

Views

Author

Keywords

Comments

All numbers of the form 2^k1*3^k2*...*p_n^k_n, where k1 >= k2 >= ... >= k_n, sorted.
A111059 is a subsequence. - Reinhard Zumkeller, Jul 05 2010
Choie et al. (2007) call these "Hardy-Ramanujan integers". - Jean-François Alcover, Aug 14 2014
The exponents k1, k2, ... can be read off Abramowitz & Stegun p. 831, column labeled "pi".
For all such sequences b for which it holds that b(n) = b(A046523(n)), the sequence which gives the indices of records in b is a subsequence of this sequence. For example, A002182 which gives the indices of records for A000005, A002110 which gives them for A001221 and A000079 which gives them for A001222. - Antti Karttunen, Jan 18 2019
The prime signature corresponding to a(n) is given in row n of A124832. - M. F. Hasler, Jul 17 2019

Examples

			The first few terms are 1, 2, 2^2, 2*3, 2^3, 2^2*3, 2^4, 2^3*3, 2*3*5, ...
		

Crossrefs

Subsequence of A055932, A191743, and A324583.
Cf. A085089, A101296 (left inverses).
Equals range of values taken by A046523.
Cf. A178799 (first differences), A247451 (squarefree kernel), A146288 (number of divisors).
Rearrangements of this sequence include A036035, A059901, A063008, A077569, A085988, A086141, A087443, A108951, A181821, A181822, A322827, A329886, A329887.
Cf. also array A124832 (row n = prime signature of a(n)) and A304886, A307056.

Programs

  • Haskell
    import Data.Set (singleton, fromList, deleteFindMin, union)
    a025487 n = a025487_list !! (n-1)
    a025487_list = 1 : h [b] (singleton b) bs where
       (_ : b : bs) = a002110_list
       h cs s xs'@(x:xs)
         | m <= x    = m : h (m:cs) (s' `union` fromList (map (* m) cs)) xs'
         | otherwise = x : h (x:cs) (s  `union` fromList (map (* x) (x:cs))) xs
         where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Apr 06 2013
    
  • Maple
    isA025487 := proc(n)
        local pset,omega ;
        pset := sort(convert(numtheory[factorset](n),list)) ;
        omega := nops(pset) ;
        if op(-1,pset) <> ithprime(omega) then
            return false;
        end if;
        for i from 1 to omega-1 do
            if padic[ordp](n,ithprime(i)) < padic[ordp](n,ithprime(i+1)) then
                return false;
            end if;
        end do:
        true ;
    end proc:
    A025487 := proc(n)
        option remember ;
        local a;
        if n = 1 then
            1 ;
        else
            for a from procname(n-1)+1 do
                if isA025487(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A025487(n),n=1..100) ; # R. J. Mathar, May 25 2017
  • Mathematica
    PrimeExponents[n_] := Last /@ FactorInteger[n]; lpe = {}; ln = {1}; Do[pe = Sort@PrimeExponents@n; If[ FreeQ[lpe, pe], AppendTo[lpe, pe]; AppendTo[ln, n]], {n, 2, 2350}]; ln (* Robert G. Wilson v, Aug 14 2004 *)
    (* Second program: generate all terms m <= A002110(n): *)
    f[n_] := {{1}}~Join~
      Block[{lim = Product[Prime@ i, {i, n}],
       ww = NestList[Append[#, 1] &, {1}, n - 1], dec},
       dec[x_] := Apply[Times, MapIndexed[Prime[First@ #2]^#1 &, x]];
       Map[Block[{w = #, k = 1},
          Sort@ Prepend[If[Length@ # == 0, #, #[[1]]],
            Product[Prime@ i, {i, Length@ w}] ] &@ Reap[
             Do[
              If[# < lim,
                 Sow[#]; k = 1,
                 If[k >= Length@ w, Break[], k++]] &@ dec@ Set[w,
                 If[k == 1,
                   MapAt[# + 1 &, w, k],
                   PadLeft[#, Length@ w, First@ #] &@
                     Drop[MapAt[# + Boole[i > 1] &, w, k], k - 1] ]],
               {i, Infinity}] ][[-1]]
    ] &, ww]]; Sort[Join @@ f@ 13] (* Michael De Vlieger, May 19 2018 *)
  • PARI
    isA025487(n)=my(k=valuation(n,2),t);n>>=k;forprime(p=3,default(primelimit),t=valuation(n,p);if(t>k,return(0),k=t);if(k,n/=p^k,return(n==1))) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    factfollow(n)={local(fm, np, n2);
      fm=factor(n); np=matsize(fm)[1];
      if(np==0,return([2]));
      n2=n*nextprime(fm[np,1]+1);
      if(np==1||fm[np,2]Franklin T. Adams-Watters, Dec 01 2011 */
    
  • PARI
    is(n) = {if(n==1, return(1)); my(f = factor(n));  f[#f~, 1] == prime(#f~) && vecsort(f[, 2],,4) == f[, 2]} \\ David A. Corneth, Feb 14 2019
    
  • PARI
    upto(Nmax)=vecsort(concat(vector(logint(Nmax,2),n,select(t->t<=Nmax,if(n>1,[factorback(primes(#p),Vecrev(p)) || p<-partitions(n)],[1,2]))))) \\ M. F. Hasler, Jul 17 2019
    
  • PARI
    \\ For fast generation of large number of terms, use this program:
    A283980(n) = {my(f=factor(n)); prod(i=1, #f~, my(p=f[i, 1], e=f[i, 2]); if(p==2, 6, nextprime(p+1))^e)}; \\ From A283980
    A025487list(e) = { my(lista = List([1, 2]), i=2, u = 2^e, t); while(lista[i] != u, if(2*lista[i] <= u, listput(lista,2*lista[i]); t = A283980(lista[i]); if(t <= u, listput(lista,t))); i++); vecsort(Vec(lista)); }; \\ Returns a list of terms up to the term 2^e.
    v025487 = A025487list(101);
    A025487(n) = v025487[n];
    for(n=1,#v025487,print1(A025487(n), ", ")); \\ Antti Karttunen, Dec 24 2019
    
  • Sage
    def sharp_primorial(n): return sloane.A002110(prime_pi(n))
    N = 2310
    nmax = 2^floor(log(N,2))
    sorted([j for j in (prod(sharp_primorial(t[0])^t[1] for k, t in enumerate(factor(n))) for n in (1..nmax)) if j <= N])
    # Giuseppe Coppoletta, Jan 26 2015

Formula

What can be said about the asymptotic behavior of this sequence? - Franklin T. Adams-Watters, Jan 06 2010
Hardy & Ramanujan prove that there are exp((2 Pi + o(1))/sqrt(3) * sqrt(log x/log log x)) members of this sequence up to x. - Charles R Greathouse IV, Dec 05 2012
From Antti Karttunen, Jan 18 & Dec 24 2019: (Start)
A085089(a(n)) = n.
A101296(a(n)) = n [which is the first occurrence of n in A101296, and thus also a record.]
A001221(a(n)) = A061395(a(n)) = A061394(n).
A007814(a(n)) = A051903(a(n)) = A051282(n).
a(A101296(n)) = A046523(n).
a(A306802(n)) = A002182(n).
a(n) = A108951(A181815(n)) = A329900(A181817(n)).
If A181815(n) is odd, a(n) = A283980(a(A329904(n))), otherwise a(n) = 2*a(A329904(n)).
(End)
Sum_{n>=1} 1/a(n) = Product_{n>=1} 1/(1 - 1/A002110(n)) = A161360. - Amiram Eldar, Oct 20 2020

Extensions

Offset corrected by Matthew Vandermast, Oct 19 2008
Minor correction by Charles R Greathouse IV, Sep 03 2010

A008966 a(n) = 1 if n is squarefree, otherwise 0.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

a(n) depends only on prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3, 1).
The infinite lower triangular matrix with A008966 on the main diagonal and the rest zeros is the square of triangle A143255. - Gary W. Adamson, Aug 02 2008

Crossrefs

Cf. A005117, A008836 (Dirichlet inverse), A013928 (partial sums).
Parity of A002033.
Cf. A082020 (Dgf at s=2), A157289 (Dgf at s=3), A157290 (Dgf at s=4).

Programs

  • Haskell
    a008966 = abs . a008683
    -- Reinhard Zumkeller, Dec 13 2015, Dec 15 2014, May 27 2012, Jan 25 2012
    
  • Magma
    [ Abs(MoebiusMu(n)) : n in [1..100]];
    
  • Maple
    A008966 := proc(n) if numtheory[issqrfree](n) then 1 ; else 0 ; end if; end proc: # R. J. Mathar, Mar 14 2011
  • Mathematica
    A008966[n_] := Abs[MoebiusMu[n]]; Table[A008966[n], {n, 100}] (* Enrique Pérez Herrero, Apr 15 2010 *)
    Table[If[SquareFreeQ[n],1,0],{n,100}] (* or *) Boole[SquareFreeQ/@ Range[ 100]] (* Harvey P. Dale, Feb 28 2015 *)
  • MuPAD
    func(abs(numlib::moebius(n)), n):
    
  • PARI
    a(n)=if(n<1,0,direuler(p=2,n,1+X))[n]
    
  • PARI
    a(n)=issquarefree(n) \\ Michel Marcus, Feb 22 2015
    
  • Python
    from sympy import factorint
    def A008966(n): return int(max(factorint(n).values(),default=1)==1) # Chai Wah Wu, Apr 05 2023

Formula

Dirichlet g.f.: zeta(s)/zeta(2s).
a(n) = abs(mu(n)), where mu is the Moebius function (A008683).
a(n) = 0^(bigomega(n) - omega(n)), where bigomega(n) and omega(n) are the numbers of prime factors of n with and without repetition (A001222, A001221, A046660). - Reinhard Zumkeller, Apr 05 2003
Multiplicative with p^e -> 0^(e - 1), p prime and e > 0. - Reinhard Zumkeller, Jul 15 2003
a(n) = 0^(A046951(n) - 1). - Reinhard Zumkeller, May 20 2007
a(n) = 1 - A107078(n). - Reinhard Zumkeller, Oct 03 2008
a(n) = floor(rad(n)/n), where rad() is A007947. - Enrique Pérez Herrero, Nov 13 2009
A175046(n) = a(n)*A073311(n). - Reinhard Zumkeller, Apr 05 2010
a(n) = floor(A000005(n^2)/A007425(n)). - Enrique Pérez Herrero, Apr 15 2010
a(A005117(n)) = 1; a(A013929(n)) = 0; a(n) = A013928(n + 1) - A013928(n). - Reinhard Zumkeller, Jul 05 2010
a(n) * A112526(n) = A063524(n). - Reinhard Zumkeller, Sep 16 2011
a(n) = mu(n) * lambda(n) = A008836(n) * A008683(n). - Enrique Pérez Herrero, Nov 29 2013
a(n) = Sum_{d|n} 2^omega(d)*mu(n/d). - Geoffrey Critzer, Feb 22 2015
a(n) = A085357(A156552(n)). - Antti Karttunen, Mar 06 2017
Limit_{n->oo} (1/n)*Sum_{j=1..n} a(j) = 6/Pi^2. - Andres Cicuttin, Aug 13 2017
a(1) = 1; a(n) = -Sum_{d|n, d < n} (-1)^bigomega(n/d) * a(d). - Ilya Gutkovskiy, Mar 10 2021

Extensions

Deleted an unclear comment. - N. J. A. Sloane, May 30 2021

A034386 Primorial numbers (second definition): n# = product of primes <= n.

Original entry on oeis.org

1, 1, 2, 6, 6, 30, 30, 210, 210, 210, 210, 2310, 2310, 30030, 30030, 30030, 30030, 510510, 510510, 9699690, 9699690, 9699690, 9699690, 223092870, 223092870, 223092870, 223092870, 223092870, 223092870, 6469693230, 6469693230, 200560490130, 200560490130
Offset: 0

Views

Author

Keywords

Comments

Squarefree kernel of both n! and lcm(1, 2, 3, ..., n).
a(n) = lcm(core(1), core(2), core(3), ..., core(n)) where core(x) denotes the squarefree part of x, the smallest integer such that x*core(x) is a square. - Benoit Cloitre, May 31 2002
The sequence can also be obtained by taking a(1) = 1 and then multiplying the previous term by n if n is coprime to the previous term a(n-1) and taking a(n) = a(n-1) otherwise. - Amarnath Murthy, Oct 30 2002; corrected by Franklin T. Adams-Watters, Dec 13 2006

Examples

			a(5) = a(6) = 2*3*5 = 30;
a(7) = 2*3*5*7 = 210.
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.3, p. 14, "n?".
  • József Sándor, Dragoslav S. Mitrinovic, Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.35, p. 268.

Crossrefs

Cf. A073838, A034387. - Reinhard Zumkeller, Jul 05 2010
The following fractions are all related to each other: Sum 1/n: A001008/A002805, Sum 1/prime(n): A024451/A002110 and A106830/A034386, Sum 1/nonprime(n): A282511/A282512, Sum 1/composite(n): A250133/A296358.

Programs

  • Magma
    [n eq 0 select 1 else LCM(PrimesInInterval(1, n)) : n in [0..50]]; // G. C. Greubel, Jul 21 2023
  • Maple
    A034386 := n -> mul(k,k=select(isprime,[$1..n])); # Peter Luschny, Jun 19 2009
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 1,
          `if`(isprime(n), n, 1)*a(n-1))
        end:
    seq(a(n), n=0..36);  # Alois P. Heinz, Nov 26 2020
  • Mathematica
    q[x_]:=Apply[Times,Table[Prime[w],{w,1,PrimePi[x]}]]; Table[q[w],{w,1,30}]
    With[{pr=FoldList[Times,1,Prime[Range[20]]]},Table[pr[[PrimePi[n]+1]],{n,0,40}]] (* Harvey P. Dale, Apr 05 2012 *)
    Table[ResourceFunction["Primorial"][i], {i,1,40}] (* Navvye Anand, May 22 2024 *)
  • PARI
    a(n)=my(v=primes(primepi(n)));prod(i=1,#v,v[i]) \\ Charles R Greathouse IV, Jun 15 2011
    
  • PARI
    a(n)=lcm(primes([2,n])) \\ Jeppe Stig Nielsen, Mar 10 2019
    
  • Python
    from sympy import primorial
    def A034386(n): return 1 if n == 0 else primorial(n,nth=False) # Chai Wah Wu, Jan 11 2022
    
  • SageMath
    def sharp_primorial(n): return sloane.A002110(prime_pi(n))
    [sharp_primorial(n) for n in (0..30)] # Giuseppe Coppoletta, Jan 26 2015
    

Formula

a(n) = n# = A002110(A000720(n)) = A007947(A003418(n)) = A007947(A000142(n)).
Asymptotic expression for a(n): exp((1 + o(1)) * n) where o(1) is the "little o" notation. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 08 2001
For n > 0, log(a(n)) < 1.01624*n. [Rosser and Schoenfeld, 1962; Sándor et al., 2005] - N. J. A. Sloane, Apr 04 2017
a(n) <= A179215(n). - Reinhard Zumkeller, Jul 05 2010
a(n) = lcm(A006530(n), a(n-1)). - Jon Maiga, Nov 10 2018
Sum_{n>=0} 1/a(n) = A249270. - Amiram Eldar, Nov 08 2020

Extensions

Offset changed and initial term added by Arkadiusz Wesolowski, Jun 04 2011

A013928 Number of (positive) squarefree numbers < n.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 8, 8, 9, 10, 11, 11, 12, 12, 13, 13, 14, 15, 16, 16, 16, 17, 17, 17, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 28, 29, 29, 29, 30, 31, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 36, 37, 37, 38, 39, 39, 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, 47, 47, 47, 48, 49, 50, 50, 50, 51
Offset: 1

Views

Author

Keywords

Comments

For n >= 1 define an n X n (0, 1) matrix A by A[i, j] = 1 if gcd(i, j) = 1, A[i, j] = 0 if gcd(i, j) > 1 for 1 <= i,j <= n . The rank of A is a(n + 1). Asymptotic expression for a(n) is a(n) ~ n * 6 / Pi^2. - Sharon Sela (sharonsela(AT)hotmail.com), May 06 2002
a(n) = Sum_{k=1..n-1} A008966(k). - Reinhard Zumkeller, Jul 05 2010
For all n >= 1, a(n)/n >= a(176)/176 = 53/88, and the equality occurs only for n=176 (see K. Rogers link). - Michel Marcus, Dec 16 2012 [Thus the Schnirelmann density of the squarefree numbers is 53/88. - Charles R Greathouse IV, Feb 02 2016]
Cohen, Dress, & El Marraki prove that |a(n) - 6n/Pi^2| < 0.02767*sqrt(n) for n >= 438653. - Charles R Greathouse IV, Feb 02 2016

Examples

			a(10) = 6 because there are 6 squarefree numbers up to 10: 1, 2, 3, 5, 6, 7.
a(11) = 7 because there are 7 squarefree numbers up to 11: the numbers listed above for 10, plus 10 itself.
a(13) = 8 because the 12 X 12 matrix described in the first comment by Sharon Sela has rank 8. Rows 2,4,8 (the powers of two) are identical, rows 3,9 (the powers of three) are identical, and rows 6 and 12 (same prime factors) are identical. - _Geoffrey Critzer_, Dec 07 2014
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 0, 1, 0, 1, 0, 1, 0, 1, 0  1, 0, ...
1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, ...
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...
1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, ...
1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, ...
1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, ...
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...
1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, ...
1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, ...
1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, ...
.                                   .
.                                    .
.                                     .
		

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, Fifth edition (1979), Clarendon Press, pp. 269-270.
  • E. Landau, Über den Zusammenhang einiger neuer Sätze der analytischen Zahlentheorie, Wiener Sitzungberichte, Math. Klasse 115 (1906), pp. 589-632. Cited in Sándor, Mitrinović, & Crstici.
  • József Sándor, Dragoslav S. Mitrinovic, and Borislav Crstici, Handbook of Number Theory I. Springer, 2005. Section VI.18.

Crossrefs

One less than A107079.
Cf. A158819 Number of squarefree numbers <= n minus round(n/zeta(2)).

Programs

  • Haskell
    a013928 n = a013928_list !! (n-1)
    a013928_list = scanl (+) 0 $ map a008966 [1..]
    -- Reinhard Zumkeller, Aug 03 2012
    
  • Maple
    ListTools:-PartialSums([0,seq(numtheory:-mobius(i)^2,i=1..100)]); # Robert Israel, Dec 11 2014
  • Mathematica
    Accumulate[Table[Abs[MoebiusMu[n]], {n, 0, 79}]] (* Alonso del Arte, Oct 07 2012 *)
    Accumulate[Table[If[SquareFreeQ[n],1,0],{n,0,80}]] (* Harvey P. Dale, Mar 06 2019 *)
  • PARI
    a(n)=sum(i=1,n-1,if(issquarefree(i),1,0)) \\ Lifchitz
    
  • PARI
    a(n)=n--;sum(k=1,sqrtint(n),moebius(k)*(n\k^2)) \\ Benoit Cloitre, Oct 25 2009
    
  • PARI
    a(n)=n--; my(s); forfactored(k=1,sqrtint(n), s += n\k[1]^2*moebius(k)); s \\ Charles R Greathouse IV, Nov 05 2017
    
  • PARI
    a(n)=n--; my(s); forsquarefree(k=1, sqrtint(n), s += n\k[1]^2*moebius(k)); s \\ Charles R Greathouse IV, Jan 08 2018
    
  • Python
    from sympy.ntheory.factor_  import core
    def a(n): return sum ([1 for i in range(1, n) if core(i) == i]) # Indranil Ghosh, Apr 16 2017
    
  • Python
    from math import isqrt
    from sympy import mobius
    def A013928(n): return sum(mobius(k)*((n-1)//k**2) for k in range(1,isqrt(n-1)+1)) # Chai Wah Wu, Jan 03 2024

Formula

a(n) = Sum_{k = 1..n-1} mu(k)^2. - Vladeta Jovovic, May 18 2001
a(n) = Sum_{d = 1..floor(sqrt(n - 1))} mu(d)*floor((n - 1)/d^2) where mu(d) is the Moebius function (A008683). - Vladeta Jovovic, Apr 06 2001
Asymptotic formula (with error term): a(n) = Sum_{k = 1..n-1} mu(k)^2 = Sum_{k = 1..n-1} |mu(k)| = 6*n/Pi^2 + O(sqrt(n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Jul 20 2002
a(n) = Sum_{k = 0..n} if(k <= n-1, mu(n - k) mod 2, else 0; a(n + 1) = Sum_{k = 0..n} mu(n - k + 1) mod 2. - Paul Barry, May 10 2005
a(n + 1) = Sum_{k = 0..n} abs(mu(n - k + 1)). - Paul Barry, Jul 20 2005
a(n) = Sum_{k = 1..floor(sqrt(n))} mu(k)*floor(n/k^2). - Benoit Cloitre, Oct 25 2009
Landau proved that a(n) = 6*n/Pi^2 + o(sqrt(n)). - Charles R Greathouse IV, Feb 02 2016
Vaidya proved that a(n) = 6*n/Pi^2 + O(n^k) for any k > 2/5 on the Riemann hypothesis. - Charles R Greathouse IV, Feb 02 2016
a(n) = A107079(n)-1. - Antti Karttunen, Oct 07 2016
G.f.: Sum_{k>=1} mu(k)^2*x^(k+1)/(1 - x). - Ilya Gutkovskiy, Feb 06 2017
a(n+1) = n - A057627(n) - Antti Karttunen, Apr 17 2017

A066779 Sum of squarefree numbers <= n.

Original entry on oeis.org

1, 3, 6, 6, 11, 17, 24, 24, 24, 34, 45, 45, 58, 72, 87, 87, 104, 104, 123, 123, 144, 166, 189, 189, 189, 215, 215, 215, 244, 274, 305, 305, 338, 372, 407, 407, 444, 482, 521, 521, 562, 604, 647, 647, 647, 693, 740, 740, 740, 740, 791, 791, 844, 844, 899, 899
Offset: 1

Views

Author

Benoit Cloitre, Jan 18 2002

Keywords

References

  • D. Suryanarayana, The number and sum of k-free integers <= x which are prime to n, Indian J. Math., Vol. 11 (1969), pp. 131-139.

Crossrefs

Programs

  • Mathematica
    Table[ n*Boole[ SquareFreeQ[n] ], {n, 1, 56}] // Accumulate (* Jean-François Alcover, Jun 18 2013 *)
  • PARI
    s=0; for (n=1, 1000, write("b066779.txt", n, " ", s+=moebius(n)^2*n) ) \\ Harry J. Smith, Mar 24 2010
    
  • PARI
    a(n)=sum(d=1,sqrtint(n),moebius(d)*d^2*binomial(n\d^2+1,2)) \\ Charles R Greathouse IV, Apr 26 2012
    
  • PARI
    a(n)=my(s,k2); forsquarefree(k=1,sqrtint(n), k2=k[1]^2; s+= k2*binomial(n\k2+1,2)*moebius(k)); s \\ Charles R Greathouse IV, Jan 08 2018
    
  • Python
    from sympy.ntheory.factor_  import core
    def a(n): return sum ([i for i in range(1, n + 1) if core(i) == i]) # Indranil Ghosh, Apr 16 2017

Formula

a(n) = Sum_{i=1..n} mu(i)^2*i.
a(n) = Sum_{k=1..n} k*A008966(k). - Reinhard Zumkeller, Jul 05 2010
a(n) = Sum_{d=1..sqrt(n)} mu(d)*d^2*floor(n/d^2)*floor(n/d^2+1)/2. - Charles R Greathouse IV, Apr 26 2012
G.f.: Sum_{k>=1} mu(k)^2*k*x^k/(1 - x). - Ilya Gutkovskiy, Apr 16 2017
a(n) ~ (3/Pi^2) * n^2 + O(n^(3/2)) (Suryanarayana, 1969). - Amiram Eldar, Mar 07 2021

A179214 Product of squarefree numbers between n and 2*n (inclusive).

Original entry on oeis.org

2, 6, 90, 210, 2100, 4620, 140140, 300300, 5105100, 96996900, 4481256780, 9369900540, 243617414040, 18739801080, 1164544781400, 2406725881560, 2700346439110320, 5559536786403600, 7816708721683461600
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2010

Keywords

Comments

A073838(n) <= a(n) <= A126804(n);
a(n) = A179215(2*n)/A179215(n-1).

Examples

			a(10) = 10*11*13*14*15*17*19 = 96996900;
a(11) = 11*13*14*15*17*19*21*22 = 4481256780;
a(12) = 13*14*15*17*19*21*22*23 = 9369900540.
		

Crossrefs

Formula

a(n) = PROD(k^A008966(k): n <= k <= 2*n).

Extensions

Example corrected by Reinhard Zumkeller, Jul 19 2010

A308819 Product of prime powers <= n.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 120, 840, 6720, 60480, 60480, 665280, 665280, 8648640, 8648640, 8648640, 138378240, 2352430080, 2352430080, 44696171520, 44696171520, 44696171520, 44696171520, 1028011944960, 1028011944960, 25700298624000, 25700298624000, 693908062848000
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 26 2019

Keywords

Comments

a(n) is the smallest number that's divisible by all numbers less than or equal to n. - Keith F. Lynch, Apr 24 2025

Examples

			a(9) = 60480 because 2, 3, 4, 5, 7, 8, 9 are the prime powers less than or equal to 9 and 2 * 3 * 4 * 5 * 7 * 8 * 9 = 60480.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[If[PrimePowerQ[k], k, 1], {k, 1, n}]; Table[a[n], {n, 0, 27}]
    Module[{nn=50,ppwr},ppwr=Select[Range[nn],PrimePowerQ[#]&];Table[Times@@ Select[ ppwr,#<= n&],{n,0,nn}]] (* Harvey P. Dale, Apr 03 2024 *)
  • PARI
    a(n) = prod(k=1, n, if (isprime(k) || isprimepower(k), k, 1)); \\ Michel Marcus, Jun 27 2019
Showing 1-8 of 8 results.