%I #108 Jun 06 2020 10:47:29
%S 2,7,11,17,23,29,31,37,37,53,53,59,67,79,79,89,97,97,127,127,127,127,
%T 127,137,137,149,157,157,179,179,191,191,211,211,211,223,223,223,233,
%U 251,251,257,293,293,307,307,307,307,307,331,331,331
%N Small Associated Ramanujan Prime, p_(i-n).
%C a(n) is the smallest prime p_(k+1-n) on the left side of the Ramanujan Prime Corollary, 2*p_(i-n) > p_i for i > k, where the n-th Ramanujan Prime R_n is the k-th prime p_k. [Comment clarified and shortened by _Jonathan Sondow_, Dec 20 2013]
%C Smallest prime number, a(n), such that if x >= a(n), then there are at least n primes between x and 2x exclusively.
%C This is very useful in showing the number of primes in the range [p_k, 2*p_(i-n)] is greater than or equal to 1. By taking into account the size of the gaps between primes in [p_(i-n),p_k], one can see that the average prime gap is about log(p_k) using the following R_n / (2*n) ~ log(R_n).
%C Proof of Corollary: See Wikipedia link
%C The number of primes until the next Ramanujan prime, R_(n+1), can be found in A190874.
%C Not the same as A124136.
%C A084140(n) is the smallest integer where ceiling ((A104272(n)+1)/2), a(n) is the next prime after A084140(n). - _John W. Nicholson_, Oct 09 2013
%C If a(n) is in A005382(k) then A005383(k) is a twin prime with the Ramanujan prime, A104272(n) = A005383(k) - 2, and A005383(k) = A168425(n). If this sequence has an infinite number of terms in A005382, then the twin prime conjecture can be proved. - _John W. Nicholson_, Dec 05 2013
%C Except for A000101(1)=3 and A000101(2)=5, A000101(k) = a(n). Because of the large size of a gap, there are many repeats of the prime number in this sequence. - _John W. Nicholson_, Dec 10 2013
%C For some n and k, we see that a(n) = A104272(k) as to form a chain of primes similar to a Cunningham chain. For example (and the first example), a(2) = 7, links A104272(2) = 11 = a(3), links A104272(3) = 17 = a(4), links A104272(4) = 29 = a(6), links A104272(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_, Dec 14 2013
%C Srinivasan's Lemma (2014): p_(k-n) < (p_k)/2 if R_n = p_k and n > 1. Proof: By the minimality of R_n, the interval ((p_k)/2,p_k] contains exactly n primes, so p_(k-n) < (p_k)/2. - _Jonathan Sondow_, May 10 2014
%C In spite of the name Small Associated Ramanujan Prime, a(n) is not a Ramanujan prime for many values of n. - _Jonathan Sondow_, May 10 2014
%C Prime index of a(n), pi(a(n)) = i-n, is equal to A179196(n) - n + 1. - _John W. Nicholson_, Sep 15 2015
%C All maximal prime pairs in A002386 and A000101 are bounded by, for a particular n and i, the prime A104272(n) and twice a prime in A000040() following a(n). This means the gap between maximal prime pair cannot be more than twice the prior maximal prime gap. - _John W. Nicholson_, Feb 07 2019
%H T. D. Noe, <a href="/A168421/b168421.txt">Table of n, a(n) for n = 1..10000</a>
%H J. Sondow, <a href="http://arxiv.org/abs/0907.5232"> Ramanujan primes and Bertrand's postulate</a>, arXiv:0907.5232 [math.NT], 2009-2010; Amer. Math. Monthly 116 (2009) 630-635.
%H J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="http://arxiv.org/abs/1105.2249"> Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, arXiv:1105.2249 [math.NT], 2011; J. Integer Seq. 14 (2011) Article 11.6.2.
%H J. Sondow, J. W. Nicholson, and T. D. Noe, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Noe/noe12.html"> Ramanujan Primes: Bounds, Runs, Twins, and Gaps</a>, J. Integer Seq. 14 (2011) Article 11.6.2
%H Anitha Srinivasan, <a href="http://www.emis.de/journals/INTEGERS/papers/o19/o19.Abstract.html">An upper bound for Ramanujan primes</a>, Integers, 19 (2014), #A19
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Ramanujan_prime">Ramanujan Prime</a>
%F a(n) = prime(primepi(A104272(n)) + 1 - n).
%F a(n) = nextprime(A084139(n+1)), where nextprime(x) is the next prime > x. Note: some A084139(n) may be prime, therefore nextprime(x) not equal to x. - _John W. Nicholson_, Oct 11 2013
%F a(n) = nextprime(A084140(n)). - _John W. Nicholson_, Oct 11 2013
%e For n=10, the n-th Ramanujan prime is A104272(n)= 97, the value of k = 25, so i is >= 26, i-n >= 16, the i-n prime is 53, and 2*53 = 106. This leaves the range [97, 106] for the 26th prime which is 101. In this example, 53 is the small associated Ramanujan prime.
%t nn = 100;
%t t = Table[0, {nn}];
%t Do[m = PrimePi[2n] - PrimePi[n]; If[0 < m <= nn, t[[m]] = n], {n, 15 nn}];
%t A084139 = Join[{1}, t];
%t a[n_] := NextPrime[A084139[[n]]];
%t Array[a, nn] (* _Jean-François Alcover_, Nov 07 2018, after _T. D. Noe_ in A084139 *)
%o (Perl) use ntheory ":all"; say next_prime((nth_ramanujan_prime($_)+1) >> 1) for 1..100; # _Dana Jacobsen_, Mar 02 2016
%Y Cf. A000101, A005382, A005383, A084139, A084140.
%Y Cf. A104272, A124136, A168425, A179196, A190874.
%Y Cf. A165959 (range size), A230147 (records).
%K nonn
%O 1,1
%A _John W. Nicholson_, Nov 25 2009
%E Extended by _T. D. Noe_, Nov 22 2010