A331834 Records of A038804: (Smallest prime > 10^n) - (largest prime < 10^n).
4, 12, 34, 70, 124, 218, 264, 540, 604, 670, 754, 1182, 1310, 1418, 2606, 2702, 3516, 4248, 7358, 7680, 7692, 9060, 9962, 17568, 18052, 23784, 28218, 29814, 31024, 34788, 41438, 48984, 59568, 68986, 75944, 82700, 83232, 91840, 113108, 132652, 153094, 167608
Offset: 1
Keywords
Examples
Smallest 2-digit prime is 11, largest 1-digit prime is 7, so 11 - 7 = 4 is a term; since there is no 0-digit prime, 4 is a(1).
Crossrefs
Cf. A038804.
Programs
-
Mathematica
Block[{s = ToExpression /@ Map[StringSplit, Drop[Import["https://oeis.org/A038804/b038804.txt", "Data"], 4]][[All, -1]]}, Union@ FoldList[Max, s]] (* Michael De Vlieger, Mar 14 2020, using b-file at A038804 *) DeleteDuplicates[Table[NextPrime[10^n]-NextPrime[10^n,-1],{n,500}],GreaterEqual] (* The program generates the first 21 terms of the sequence. *) (* Harvey P. Dale, Aug 18 2025 *)
-
PARI
d=0;for(k=1,500,my(t=10^k,dd=nextprime(t)-precprime(t));if(dd>d,print1(dd,", ");d=dd)) \\ Hugo Pfoertner, Mar 01 2020
Extensions
a(37)-a(42) from Giovanni Resta, Mar 15 2020
Comments