login
First n-digit prime in consecutive digits of e.
1

%I #16 Feb 16 2025 08:33:07

%S 7,71,281,4523,74713,904523,6028747,72407663,360287471,7427466391,

%T 75724709369,749669676277,8284590452353,99959574966967,

%U 724709369995957,2470936999595749,28459045235360287,571382178525166427

%N First n-digit prime in consecutive digits of e.

%C If the "2" at the beginning of e is included, the only values for n <= 1000 that change are a(1) = 2, a(3) = 271 and a(85) = 2718281828459045235360287471352662497757247093699959574966967627724076630353547594571.

%C For another version starting with 2 see A095935. - _Omar E. Pol_, Oct 24 2011

%H Dan Drake, <a href="/A137443/b137443.txt">Table of n, a(n) for n = 1..1000</a>

%H Pegg, E. Jr. and Weisstein, E. W. <a href="https://mathworld.wolfram.com/news/2004-10-13/google/">Mathematica's Google Aptitude</a>. MathWorld Headline news, Oct 13, 2004.

%e 7427466391 is the first 10-digit prime found in consecutive digits of e, so a(10) = 7427466391.

%o (Sage)

%o def a(digits):

%o bits = 0

%o pos = 0

%o while True:

%o bits += (digits * 4) + 50

%o decimals = RealField(bits, rnd='RNDZ')(exp(1)).frac().str()[2:]

%o for s in range(pos, len(decimals) - digits + 1):

%o if decimals[s] != '0':

%o i = Integer(decimals[s:s+digits])

%o if i.is_prime():

%o return i

%o pos = len(decimals) - digits + 1

%Y Cf. A095926.

%Y Cf. A001113, A095935. - _Omar E. Pol_, Oct 24 2011

%K base,nonn,changed

%O 1,1

%A _Dan Drake_, Apr 18 2008