A328032 If there are m primes between 10^(n-1) and 10^n, a(n) is the middle prime if m is odd, otherwise the larger of the two middle primes.
5, 47, 509, 5273, 53047, 532907, 5356259, 53765519, 539119753, 5402600081, 54118210441, 541947386821, 5425907665571, 54313871643797, 543611236251491, 5440228524355381, 54438462600610513, 544705097744731559, 5449909581264135103
Offset: 1
Examples
a(1) is 5 since, among the single-digit primes, i.e., {2, 3, 5, 7}, the two middle primes are {3, 5}, of which the larger one is 5; a(2) is 47 since it is the middle prime of the two-digit primes, i.e., {11, 13, 17, ..., 47, ..., 83, 89, 97}; a(3) is 509 since it is the middle prime of the three-digit primes, i.e., {101, 103, 107, ..., 509, ..., 983, 991, 997}.
Programs
-
Mathematica
f[n_] := Block[{p = PrimePi[ 10^(n -1)], q = PrimePi[ 10^n]}, Prime[ Ceiling[(q +p +1)/2]]]; Array[f, 13]
Formula
a(n) is the next prime after A309329(n) - 1.
Comments