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-10 of 25 results. Next

A055718 Erroneous version of A056171.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The old definition was "Number of distinct prime factors of EulerPhi(n!) minus number of primes dividing n!". This comes nowhere nearing producing the given terms, which apart from a(3) are the same as those of A056171.

A280379 a(n) = A056171(k) - m, where k=prime(n) and m is the Ramanujan prime index to the greatest Ramanujan prime R(m) <= k.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 2, 0, 1, 1, 2, 0, 0, 1, 1, 0, 1, 0, 0, 1, 2, 2, 3, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0
Offset: 1

Views

Author

John W. Nicholson, Jan 01 2017

Keywords

Comments

a(n)=0 corresponds to the Ramanujan prime R_m = A104272(m) = A056171(k).

Examples

			For prime(30)=113, A056171(113) = 14, 107 is R_12 and 127 is R_13, so 14 -12 = 2 (first occurrence).
		

Crossrefs

Programs

  • PARI
    \\RR[x] is a list of Ramanujan primes, A104272.
    {plimit=1.1*10^4;n=s=0;
    forprime(p=2,plimit,
        s++;
        if(p==RR[n+1],n++);
        print1(s-primepi(floor(p/2))-n,", ");
        )
    }

Formula

a(n) = A056171(k) - m, where k=prime(n) and m is the Ramanujan prime index to the greatest Ramanujan prime R_m = A104272(m) <= k.

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

A104272 Ramanujan primes R_n: a(n) is the smallest number such that if x >= a(n), then pi(x) - pi(x/2) >= n, where pi(x) is the number of primes <= x.

Original entry on oeis.org

2, 11, 17, 29, 41, 47, 59, 67, 71, 97, 101, 107, 127, 149, 151, 167, 179, 181, 227, 229, 233, 239, 241, 263, 269, 281, 307, 311, 347, 349, 367, 373, 401, 409, 419, 431, 433, 439, 461, 487, 491, 503, 569, 571, 587, 593, 599, 601, 607, 641, 643, 647, 653, 659
Offset: 1

Views

Author

Jonathan Sondow, Feb 27 2005

Keywords

Comments

Referring to his proof of Bertrand's postulate, Ramanujan (1919) states a generalization: "From this we easily deduce that pi(x) - pi(x/2) >= 1, 2, 3, 4, 5, ..., if x >= 2, 11, 17, 29, 41, ..., respectively." Since the a(n) are prime (by their minimality), I call them "Ramanujan primes."
See the additional references and links mentioned in A143227.
2n log 2n < a(n) < 4n log 4n for n >= 1, and prime(2n) < a(n) < prime(4n) if n > 1. Also, a(n) ~ prime(2n) as n -> infinity.
Shanta Laishram has proved that a(n) < prime(3n) for all n >= 1.
a(n) - 3n log 3n is sometimes positive, but negative with increasing frequency as n grows since a(n) ~ 2n log 2n. There should be a constant m such that for n >= m we have a(n) < 3n log 3n.
A good approximation to a(n) = R_n for n in [1..1000] is A162996(n) = round(k*n * (log(k*n)+1)), with k = 2.216 determined empirically from the first 1000 Ramanujan primes, which approximates the {k*n}-th prime number which in turn approximates the n-th Ramanujan prime and where abs(A162996(n) - R_n) < 2 * sqrt(A162996(n)) for n in [1..1000]. Since R_n ~ prime(2n) ~ 2n * (log(2n)+1) ~ 2n * log(2n), while A162996(n) ~ prime(k*n) ~ k*n * (log(k*n)+1) ~ k*n * log(k*n), A162996(n) / R_n ~ k/2 = 2.216/2 = 1.108 which implies an asymptotic overestimate of about 10% (a better approximation would need k to depend on n and be asymptotic to 2). - Daniel Forgues, Jul 29 2009
Let p_n be the n-th prime. If p_n >= 3 is in the sequence, then all integers (p_n+1)/2, (p_n+3)/2, ..., (p_(n+1)-1)/2 are composite numbers. - Vladimir Shevelev, Aug 12 2009
Denote by q(n) the prime which is the nearest from the right to a(n)/2. Then there exists a prime between a(n) and 2q(n). Converse, generally speaking, is not true, i.e., there exist primes outside the sequence, but possess such property (e.g., 109). - Vladimir Shevelev, Aug 14 2009
The Mathematica program FasterRamanujanPrimeList uses Laishram's result that a(n) < prime(3n).
See sequence A164952 for a generalization we call a Ramanujan k-prime. - Vladimir Shevelev, Sep 01 2009
From Jonathan Sondow, May 22 2010: (Start)
About 46% of primes < 19000 are Ramanujan primes. About 78% of the lesser of twin primes < 19000 are Ramanujan primes.
About 15% of primes < 19000 are the lesser of twin primes. About 26% of Ramanujan primes < 19000 are the lesser of twin primes.
A reason for the jumps is in Section 7 of "Ramanujan primes and Bertrand's postulate" and in Section 4 of "Ramanujan Primes: Bounds, Runs, Twins, and Gaps". (See the arXiv link for a corrected version of Table 1.)
See Shapiro 2008 for an exposition of Ramanujan's proof of his generalization of Bertrand's postulate. (End)
The (10^n)-th R prime: 2, 97, 1439, 19403, 242057, 2916539, 34072993, 389433437, .... - Robert G. Wilson v, May 07 2011, updated Aug 02 2012
The number of R primes < 10^n: 1, 10, 72, 559, 4459, 36960, 316066, 2760321, .... - Robert G. Wilson v, Aug 02 2012
a(n) = R_n = R_{0.5,n} in "Generalized Ramanujan Primes."
All Ramanujan primes are in A164368. - Vladimir Shevelev, Aug 30 2011
If n tends to infinity, then limsup(a(n) - A080359(n-1)) = infinity; conjecture: also limsup(a(n) - A080359(n)) = infinity (cf. A182366). - Vladimir Shevelev, Apr 27 2012
Or the largest prime x such that the number of primes in (x/2,x] equals n. This equivalent definition underlines an important analogy between Ramanujan and Labos primes (cf. A080359). - Vladimir Shevelev, Apr 29 2012
Research questions on R_n - prime(2n) are at A233739, and on n-Ramanujan primes at A225907. - Jonathan Sondow, Dec 16 2013
The questions on R_n - prime(2n) in A233739 have been answered by Christian Axler in "On generalized Ramanujan primes". - Jonathan Sondow, Feb 13 2014
Srinivasan's Lemma (2014): prime(k-n) < prime(k)/2 if R_n = prime(k) and n > 1. Proof: By the minimality of R_n, the interval (prime(k)/2,prime(k)] contains exactly n primes and so prime(k-n) < prime(k)/2. - Jonathan Sondow, May 10 2014
For some n and k, we see that A168421(k) = a(n) so as to form a chain of primes similar to a Cunningham chain. For example (and the first example), A168421(2) = 7, links a(2) = 11 = A168421(3), links a(3) = 17 = A168421(4), links a(4) = 29 = A168421(6), links a(6) = 47. Note that the links do not have to be of a form like q = 2*p+1 or q = 2*p-1. - John W. Nicholson, Feb 22 2015
Extending Sondow's 2010 comments: About 48% of primes < 10^9 are Ramanujan primes. About 76% of the lesser of twin primes < 10^9 are Ramanujan primes. - Dana Jacobsen, Sep 06 2015
Sondow, Nicholson, and Noe's 2011 conjecture that pi(R_{m*n}) <= m*pi(R_n) for m >= 1 and n >= N_m (see A190413, A190414) was proved for n > 10^300 by Shichun Yang and Alain Togbé in 2015. - Jonathan Sondow, Dec 01 2015
Berliner, Dean, Hook, Marr, Mbirika, and McBee (2016) prove in Theorem 18 that the graph K_{m,n} is prime for n >= R_{m-1}-m; see A291465. - Jonathan Sondow, May 21 2017
Okhotin (2012) uses Ramanujan primes to prove Lemma 8 in "Unambiguous finite automata over a unary alphabet." - Jonathan Sondow, May 30 2017
Sepulcre and Vidal (2016) apply Ramanujan primes in Remark 9 of "On the non-isolation of the real projections of the zeros of exponential polynomials." - Jonathan Sondow, May 30 2017
Axler and Leßmann (2017) compute the first k-Ramanujan prime for k >= 1 + epsilon; see A277718, A277719, A290394. - Jonathan Sondow, Jul 30 2017

Examples

			a(1) = 2 is Bertrand's postulate: pi(x) - pi(x/2) >= 1 for all x >= 2.
a(2) = 11 because a(2) < 8 log 8 < 17 and pi(n) - pi(n/2) > 1 for n = 16, 15, ..., 11 but pi(10) - pi(5) = 1.
Consider a(9)=71. Then the nearest prime > 71/2 is 37, and between a(9) and 2*37, that is, between 71 and 74, there exists a prime (73). - _Vladimir Shevelev_, Aug 14 2009 [corrected by _Jonathan Sondow_, Jun 17 2013]
		

References

  • Srinivasa Ramanujan, Collected Papers of Srinivasa Ramanujan (Ed. G. H. Hardy, S. Aiyar, P. Venkatesvara and B. M. Wilson), Amer. Math. Soc., Providence, 2000, pp. 208-209.
  • Harold N. Shapiro, Ramanujan's idea, Section 9.3B in Introduction to the Theory of Numbers, Dover, 2008.

Crossrefs

Cf. A006992 (Bertrand primes), A056171 (pi(n) - pi(n/2)).
Cf. A162996 (Round(kn * (log(kn)+1)), with k = 2.216 as an approximation of R_n = n-th Ramanujan Prime).
Cf. A163160 (Round(kn * (log(kn)+1)) - R_n, where k = 2.216 and R_n = n-th Ramanujan prime).
Cf. A178127 (Lesser of twin Ramanujan primes), A178128 (Lesser of twin primes if it is a Ramanujan prime).
Cf. A181671 (number of Ramanujan primes less than 10^n).
Cf. A174635 (non-Ramanujan primes), A174602, A174641 (runs of Ramanujan and non-Ramanujan primes).
Cf. A189993, A189994 (lengths of longest runs).
Cf. A190124 (constant of summation: 1/a(n)^2).
Cf. A192820 (2- or derived Ramanujan primes R'_n), A192821, A192822, A192823, A192824, A225907.
Cf. A193761 (0.25-Ramanujan primes), A193880 (0.75-Ramanujan primes).
Cf. A185004 - A185007 ("modular" Ramanujan primes).
Not to be confused with the Ramanujan numbers or Ramanujan tau function, A000594.

Programs

  • Maple
    A104272 := proc(n::integer)
        local R;
        if n = 1 then
            return 2;
        end if;
        R := ithprime(3*n-1) ; # upper limit Laishram's thrm Thrm 3 arXiv:1105.2249
        while true do
            if A056171(R) = n then # Defn. 1. of Shevelev JIS 14 (2012) 12.1.1
                return R ;
            end if;
            R := prevprime(R) ;
        end do:
    end proc:
    seq(A104272(n),n=1..200) ; # slow downstream search <= p(3n-1) R. J. Mathar, Sep 21 2017
  • Mathematica
    (RamanujanPrimeList[n_] := With[{T=Table[{k,PrimePi[k]-PrimePi[k/2]}, {k,Ceiling[N[4*n*Log[4*n]]]}]}, Table[1+First[Last[Select[T,Last[ # ]==i-1&]]],{i,1,n}]]; RamanujanPrimeList[54]) (* Jonathan Sondow, Aug 15 2009 *)
    (FasterRamanujanPrimeList[n_] := With[{T=Table[{k,PrimePi[k]-PrimePi[k/2]}, {k,Prime[3*n]}]}, Table[1+First[Last[Select[T,Last[ # ]==i-1&]]],{i,1,n}]]; FasterRamanujanPrimeList[54])
    nn=1000; R=Table[0,{nn}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[sT. D. Noe, Nov 15 2010 *)
  • PARI
    ramanujan_prime_list(n) = {my(L=vector(n), s=0, k=1); for(k=1, prime(3*n)-1, if(isprime(k), s++); if(k%2==0 && isprime(k/2), s--); if(sSatish Bysany, Mar 02 2017
  • Perl
    use ntheory ":all"; my $r = ramanujan_primes(1000); say "[@$r]"; # Dana Jacobsen, Sep 06 2015
    

Formula

a(n) = 1 + max{k: pi(k) - pi(k/2) = n - 1}.
a(n) = A080360(n-1) + 1 for n > 1.
a(n) >= A080359(n). - Vladimir Shevelev, Aug 20 2009
A193761(n) <= a(n) <= A193880(n).
a(n) = 2*A084140(n) - 1, for n > 1. - Jonathan Sondow, Dec 21 2012
a(n) = prime(2n) + A233739(n) = (A233822(n) + a(n+1))/2. - Jonathan Sondow, Dec 16 2013
a(n) = max{prime p: pi(p) - pi(p/2) = n} (see Shevelev 2012). - Jonathan Sondow, Mar 23 2016
a(n) = A000040(A179196(n)). - R. J. Mathar, Sep 21 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = A190303. - Amiram Eldar, Nov 20 2020

A080359 The smallest integer x > 0 such that the number of primes in (x/2, x] equals n.

Original entry on oeis.org

2, 3, 13, 19, 31, 43, 53, 61, 71, 73, 101, 103, 109, 113, 139, 157, 173, 181, 191, 193, 199, 239, 241, 251, 269, 271, 283, 293, 313, 349, 353, 373, 379, 409, 419, 421, 433, 439, 443, 463, 491, 499, 509, 523, 577, 593, 599, 601, 607, 613, 619, 647, 653, 659
Offset: 1

Views

Author

Labos Elemer, Feb 21 2003

Keywords

Comments

a(n) is the same as: Smallest integer x > 0 such that the number of unitary-prime-divisors of x! equals n.
Let p_n be the n-th prime. If p_n>3 is in the sequence, then all integers (p_n-1)/2, (p_n-3)/2, ..., (p_(n-1)+1)/2 are composite numbers. - Vladimir Shevelev, Aug 12 2009
For n >= 3, denote by q(n) the prime which is the nearest from the left to a(n)/2. Then there exists a prime between 2q(n) and a(n). The converse, generally speaking, is not true; i.e., there exist primes that are outside the sequence, but possess such property (e.g., 131). - Vladimir Shevelev, Aug 14 2009
See sequence A164958 for a generalization. - Vladimir Shevelev, Sep 02 2009
a(n) is the n-th Labos prime.

Examples

			n=5: in 31! five unitary-prime-divisors appear (firstly): {17,19,23,29,31}, while other primes {2,3,5,7,11,13} are at least squared. Thus a(5)=31.
Consider a(9)=71. Then the nearest prime < 71/2 is q(9)=31, and between 2q(9) and a(9), i.e., between 62 and 71 there exists a prime (67). - _Vladimir Shevelev_, Aug 14 2009
		

Crossrefs

Cf. A104272 (Ramanujan primes).
Cf. A060756, A080360 (largest integer x with n primes in (x/2,x]).

Programs

  • Mathematica
    nn=1000; t=Table[0, {nn+1}]; s=0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s<=nn && t[[s+1]]==0, t[[s+1]]=k], {k, Prime[3*nn]}]; Rest[t]
    (* Second program: *)
    a[1] = 2; a[n_] := a[n] = Module[{x = a[n-1]}, While[(PrimePi[x]-PrimePi[Quotient[x, 2]]) != n, x++ ]; x]; Array[a, 54] (* Jean-François Alcover, Sep 14 2018 *)
  • PARI
    a(n) = {my(x = 1); while ((primepi(x) - primepi(x\2)) != n, x++;); x;} \\ Michel Marcus, Jan 15 2014
    
  • Sage
    def A():
        i = 0; n = 1
        while True:
            p = prime_pi(i) - prime_pi(i//2)
            if p == n:
                yield i
                n += 1
            i += 1
    A080359 = A()
    [next(A080359) for n in range(54)] # Peter Luschny, Sep 03 2014

Formula

a(n) = Min{x; Pi[x]-Pi[x/2]=n} = Min{x; A056171(x)=n}=Min{x; A056169(n!)=n}; where Pi()=A000720().
a(n) <= A193507(n) (cf. A194186). - Vladimir Shevelev, Aug 18 2011

Extensions

Definition corrected by Jonathan Sondow, Aug 10 2008
Shrunk title and moved part of title to comments by John W. Nicholson, Sep 18 2011

A325508 Product of primes indexed by the prime exponents of n!.

Original entry on oeis.org

1, 1, 2, 4, 10, 20, 42, 84, 204, 476, 798, 1596, 3828, 7656, 12276, 24180, 36660, 73320, 120840, 241680, 389424, 785680, 1294440, 2588880, 3848880, 7147920, 11264760, 15926040, 26057304, 52114608, 74421648, 148843296, 187159392, 340949280, 527531760, 926505360
Offset: 0

Views

Author

Gus Wiseman, May 08 2019

Keywords

Comments

The prime indices of a(n) are the signature of n!, which is row n of A115627.

Examples

			We have 7! = 2^4 * 3^2 * 5^1 * 7^1, so a(7) = prime(4)*prime(2)*prime(1)*prime(1) = 84.
The sequence of terms together with their prime indices begins:
          1: {}
          1: {}
          2: {1}
          4: {1,1}
         10: {1,3}
         20: {1,1,3}
         42: {1,2,4}
         84: {1,1,2,4}
        204: {1,1,2,7}
        476: {1,1,4,7}
        798: {1,2,4,8}
       1596: {1,1,2,4,8}
       3828: {1,1,2,5,10}
       7656: {1,1,1,2,5,10}
      12276: {1,1,2,2,5,11}
      24180: {1,1,2,3,6,11}
      36660: {1,1,2,3,6,15}
      73320: {1,1,1,2,3,6,15}
     120840: {1,1,1,2,3,8,16}
     241680: {1,1,1,1,2,3,8,16}
		

Crossrefs

Programs

  • Mathematica
    Table[Times@@Prime/@Last/@If[(n!)==1,{},FactorInteger[n!]],{n,0,30}]

Formula

a(n) = A181819(n!).
A001221(a(n)) = A071626(n).
A001222(a(n)) = A000720(n).
A056239(a(n)) = A022559(n).
A003963(a(n)) = A135291(n).
A061395(a(n)) = A011371(n).
A007814(a(n)) = A056171(n).
a(n) = A122111(A307035(n)). - Antti Karttunen, Nov 19 2019

A056172 Number of non-unitary prime divisors of n!.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14
Offset: 1

Views

Author

Labos Elemer, Jul 27 2000

Keywords

Comments

A non-unitary prime divisor for n! cannot exceed n/2.

Examples

			10! = 2^8 * 3^4 * 5^2 * 7. The non-unitary prime divisors are 2, 3, and 5 because their exponents exceed 1, so a(10) = 3.  The only unitary prime divisor of 10! is 7.
		

Crossrefs

Programs

Formula

a(n) = pi(n/2).
A prime divisor of x is non-unitary iff its exponent is at least 2 in the prime power factorization of x. In general, GCD(p, x/p) = 1 or p. Cases are counted when GCD(p, n/p) > 1.
a(n) = A000720(n) - A056171(n). - Robert G. Wilson v, Apr 09 2017
a(n) = A056170(n!). - Amiram Eldar, Jul 24 2024

Extensions

Example corrected by Jon E. Schoenfield, Sep 30 2013

A063956 Sum of unitary prime divisors of n.

Original entry on oeis.org

0, 2, 3, 0, 5, 5, 7, 0, 0, 7, 11, 3, 13, 9, 8, 0, 17, 2, 19, 5, 10, 13, 23, 3, 0, 15, 0, 7, 29, 10, 31, 0, 14, 19, 12, 0, 37, 21, 16, 5, 41, 12, 43, 11, 5, 25, 47, 3, 0, 2, 20, 13, 53, 2, 16, 7, 22, 31, 59, 8, 61, 33, 7, 0, 18, 16, 67, 17, 26, 14, 71, 0, 73, 39, 3, 19, 18, 18, 79, 5, 0
Offset: 1

Views

Author

Labos Elemer, Sep 04 2001

Keywords

Examples

			The prime divisors of 420 = 2^2 * 3 * 5 * 7. Among them, those that have exponent 1 (i.e., unitary prime divisors) are {3, 5, 7}, so a(420) = 3 + 5 + 7 = 15.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, # &, And[PrimeQ@ #, GCD[#, n/#] == 1] &], {n, 81}] (* Michael De Vlieger, Feb 17 2019 *)
    f[p_, e_] := If[e == 1, p, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jul 24 2024 *)
    Join[{0},Table[Total[Select[FactorInteger[n],#[[2]]==1&][[;;,1]]],{n,2,100}]] (* Harvey P. Dale, Jan 26 2025 *)
  • PARI
    { for (n=1, 1000, f=factor(n)~; a=0; for (i=1, length(f), if (f[2, i]==1, a+=f[1, i])); write("b063956.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 04 2009

Formula

a(n*m) = a(n) + a(m) - a(gcd(n^2, m)) - a(gcd(n, m^2)) for all n and m > 0 (conjecture). - Velin Yanev, Feb 17 2019
From Amiram Eldar, Jul 24 2024: (Start)
a(n) = A008472(n) - A063958(n).
Additive with a(p^e) = p is e = 1, and 0 otherwise. (End)

Extensions

Example clarified by Harvey P. Dale, Jan 26 2025

A080360 a(n) is the largest positive integer x such that the number of unitary-prime-divisors of x! equals n. Same as the largest positive integer x such that the number of primes in (x/2,x] equals n.

Original entry on oeis.org

10, 16, 28, 40, 46, 58, 66, 70, 96, 100, 106, 126, 148, 150, 166, 178, 180, 226, 228, 232, 238, 240, 262, 268, 280, 306, 310, 346, 348, 366, 372, 400, 408, 418, 430, 432, 438, 460, 486, 490, 502, 568, 570, 586, 592, 598, 600, 606, 640, 642, 646, 652, 658, 676
Offset: 1

Views

Author

Labos Elemer, Feb 21 2003

Keywords

Examples

			n=5: in 46! five unitary-prime-divisors[UPD] appear: {29,31,37,41,43}. In larger factorials number of UPD is not more equal 5. Thus a(5)=46.
		

References

  • S. Ramanujan, Collected Papers of Srinivasa Ramanujan (Ed. G. H. Hardy, S. Aiyar, P. Venkatesvara and B. M. Wilson), Amer. Math. Soc., Providence, 2000, pp. 208-209.

Crossrefs

Cf. A104272 (Ramanujan primes).

Programs

  • Mathematica
    nn = 60; R = Table[0, {nn}]; s = 0;
    Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, R[[s+1]] = k], {k, Prime[3*nn]}];
    Rest[R] (* Jean-François Alcover, Dec 02 2018, after T. D. Noe in A104272 *)

Formula

a(n) = Max{x; Pi[x]-Pi[x/2]=n} = Max{x; A056171(x)=n} = Max{x; A056169(n!)=n}; where Pi()=A000720().
a(n) = A104272(n+1) - 1. [Jonathan Sondow, Aug 11 2008]

Extensions

Definition corrected by Jonathan Sondow, Aug 10 2008

A294602 a(n) = pi(n-1) - pi(floor(n/2)), where pi is A000720.

Original entry on oeis.org

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

Views

Author

Arkadiusz Wesolowski, Nov 03 2017

Keywords

Comments

Number of primes in the interval (n/2, n).
Number of primes among the larger parts of the partitions of n into two distinct parts. For n=8, the partitions of 8 into two distinct parts are (7,1), (6,2), (5,3); 7 and 5 are prime so a(8) = 2. - Wesley Ivan Hurt, Apr 07 2018

Examples

			a(8) = 2 because there are 2 primes between 4 and 8: 5, 7.
a(19) = 3 because there are 3 primes between 9 and 19: 11, 13, 17.
		

Crossrefs

Programs

  • Magma
    [0, 0] cat [#PrimesInInterval(Floor(n/2)+1, n-1): n in [3..86]];
    
  • Maple
    A294602 := proc(n)
        numtheory[pi](n-1)-numtheory[pi](floor(n/2)) ;
    end proc:
    seq(A294602(n),n=1..120) ; # R. J. Mathar, Dec 17 2017
  • Mathematica
    Array[PrimePi[# - 1] - PrimePi[Floor[#/2]] &, 86] (* Michael De Vlieger, Nov 03 2017 *)
  • PARI
    vector(86, n, primepi(n-1)-primepi(n\2))

Formula

a(n) = A056171(n) - A010051(n).
a(n) = Sum_{i=1..floor((n-1)/2)} A010051(n-i). - Wesley Ivan Hurt, Apr 07 2018
Showing 1-10 of 25 results. Next