%I #67 Oct 21 2023 06:14:44
%S 2,5,277,5195977,1801241230056600523
%N a(n) = smallest prime p such that Sum_{primes q = 2, ..., p} 1/q exceeds n.
%C The indices of these primes are in A046024: a(n) = A000040(A046024(n)).
%C Comment from Eric Bach, Jun 03 2005: Schoenfeld (Math. Comp. 1976) has explicit estimates that imply, assuming the Riemann hypothesis, that the sum first exceeds 4 for some x in the range (1.80124093... * 10^18, 1.80124152... * 10^18).
%C Eric Bach (Sep 14 2005) comments that the next element in the sequence is about 4.2 * 10^49, so it may remain unknown for all eternity.
%C Comment from Richard C. Schroeppel, Nov 09 2006: The Bach-Sorenson algorithm takes around x^(1/3) space and x^(2/3) time. When x = 4 * 10^49, these are roughly 10^16 and 10^33. We have facilities today that handle 10^16 storage. Current world computing capability is ~10^25 instructions/year (10^8.5 machines, 10^9.5 inst/sec, 10^7.5 sec/year). The algorithm seems very parallelizable. So with current resources, we could have the value for a(5) in a mere 10^8 years. This might seem like a long time, but it's far short of eternity.
%C The sequence is less than 2^3^n for all n >= 1. Moreover, the limit a of a_n^e^(-n) seems to exist and is approximately 2.16 and thus a^e^n is an estimate for the sequence which is not completely wrong. - Wolfgang Burmeister (Wolfgang-Burmeister(AT)t-online.de), May 05 2007
%C Sequence can be approximated by the simple expression a(n) = exp(exp(n-0.2615)) due to the behavior of the sum of reciprocals of primes. This gives: a(4)=1.801..*10^18; a(5)=4.2..*10^49 and a(6)=7.7..*10^134. - _Carmine Suriano_, Mar 25 2014
%D Calvin C. Clawson, Mathematical Mysteries, The Beauty and Magic of Numbers, Plenum Press, NY and London, 1996, page 64.
%H E. Bach, D. Klyve, and J. P. Sorenson, <a href="http://dx.doi.org/10.1090/S0025-5718-09-02249-2">Computing prime harmonic sums</a>, Math. Comp. 78 (268) (2009) 2283-2305.
%H Eric Bach and Jonathan Sorenson, <a href="https://web.archive.org/web/20070418092522/http://euclid.butler.edu/~sorenson/papers/sum1p.pdf">Computing Prime Harmonic Sums</a> [Wayback Machine cached version]
%H J. Barkley Rosser and Lowell Schoenfeld, <a href="https://doi.org/10.1090/S0025-5718-1975-0457373-7">Sharper bounds for the Chebyshev functions theta(x) and psi(x)</a>, Collection of articles dedicated to Derrick Henry Lehmer on the occasion of his seventieth birthday. Math. Comp. 29 (1975), 243-269.
%H Lowell Schoenfeld, <a href="https://doi.org/10.1090/S0025-5718-1976-0457374-X">Sharper bounds for the Chebyshev functions theta (x) and psi (x). II</a>. Math. Comp. 30 (1976), number 134, 337-360.
%H Lowell Schoenfeld, <a href="https://doi.org/10.1090/S0025-5718-76-99659-9">Corrigendum: "Sharper bounds for the Chebyshev functions theta (x) and psi (x). II" (Math. Comput. 30 (1976), number 134, 337-360)</a>, Math. Comp. 30 (1976), number 136, 900.
%H <a href="/index/1#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%F From _Jonathan Sondow_, Apr 17 2013: (Start)
%F a(n) = A000040(A000720(A223037(n))+1).
%F a(n) ~ prime(floor(e^e^n)) = A000040(A096232(n)) as n -> oo (see comment in A223037). (End)
%t s = 0; k = 1; Do[ While[ s = N[ s + 1/Prime[ k ], 36 ]; s <= n, k++ ]; Print[ Prime[ k ] ]; k++, {n, 1, 3} ]
%t s = 0; n = 0; For[k = 1, k > 0, k++, If[(s = N[s + 1/(p = Prime[k]), 40]) > n, Print[p|s]; n++ ]] (* Wolfgang Burmeister (Wolfgang-Burmeister(AT)t-online.de), May 05 2007 *)
%o (PARI) a(n)=my(t); forprime(p=2,, t+=1./p; if(t>n, return(p))) \\ _Charles R Greathouse IV_, Apr 29 2015
%Y Cf. A046024, A223037, A281889.
%K nonn,nice,hard,more
%O 0,1
%A _Robert G. Wilson v_
%E a(0) from Wolfgang Burmeister (Wolfgang-Burmeister(AT)t-online.de), May 05 2007
%E a(3) corrected by Ulrich Schimke (UlrSchimke(AT)aol.com)
%E a(4) computed by Eric Bach and Jon Sorenson, Sep 14 2005. They used a variant of the Lagarias-Miller-Odlyzko algorithm for pi(x) and found that sum_{p <= 1801241230056600467} 1/p = 3.99999999999999999966 and sum_{p <= 1801241230056600523} 1/p = 4.00000000000000000021. There are no primes between 1801241230056600467 and 1801241230056600523. Total computing time was about two weeks, divided between two workstations (i.e., about a week on each).