login
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.
0

%I #13 Oct 07 2019 16:02:01

%S 5,47,509,5273,53047,532907,5356259,53765519,539119753,5402600081,

%T 54118210441,541947386821,5425907665571,54313871643797,

%U 543611236251491,5440228524355381,54438462600610513,544705097744731559,5449909581264135103

%N 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.

%C This sequence, unlike A309329, only contains primes.

%C For n > 2, a(n) > 10*a(n-1) for the terms shown. Does this continue?

%C The prime index of a(n): 3, 15, 97, 699, 5411, 44046, 371539, 3213018, 28304495, 252950023, 2286553663, 20862983416, 191836724429, 1775503643821, 16524756086736, 154541455728298, 1451397749344080, 13681755722697547, 129398810782042734, 1227438634918631724, 11674044544289825385, 111297278087667319110, 1063393839148059937607, 10180460079478002418395, 97640954583246485139774, 938046530135790455369642, 9025853588857058793877502, ..., .

%F a(n) is the next prime after A309329(n) - 1.

%e 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;

%e a(2) is 47 since it is the middle prime of the two-digit primes, i.e., {11, 13, 17, ..., 47, ..., 83, 89, 97};

%e a(3) is 509 since it is the middle prime of the three-digit primes, i.e., {101, 103, 107, ..., 509, ..., 983, 991, 997}.

%t f[n_] := Block[{p = PrimePi[ 10^(n -1)], q = PrimePi[ 10^n]}, Prime[ Ceiling[(q +p +1)/2]]]; Array[f, 13]

%Y Cf. A006879, A006880, A309329, A309359.

%K nonn,hard

%O 1,1

%A _Robert G. Wilson v_, Oct 02 2019