This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A124202 #30 Mar 13 2021 00:58:32 %S A124202 3,12,53,229,947,3863,15731,63823,258737 %N A124202 a(n) = median of the largest prime dividing a random n-digit number. %C A124202 A randomly selected n-digit number (uniformly distributed on 10^(n-1) to 10^n-1) has at least a 50% probability of having a prime factor at least as large as a(n). %C A124202 For n >= 2 the number m = 9*10^(n-1) of n-digit numbers is even. The median is taken to be the average of the (m/2)-th and (m/2+1)-th of the sorted list of largest prime factors. - _Robert Israel_, Dec 11 2015 %D A124202 D. E. Knuth, The Art of Computer Programming, Seminumerical Algorithms, Addison-Wesley, Reading, MA, 1969, Vol. 2. %e A124202 The largest prime divisors of the nonunit 1-digit numbers are 2, 3, 2, 5, 3, 7, 2 and 3 respectively, with median 3. %e A124202 Of the 90 2-digit numbers, there are 45 whose largest prime divisor is 11 or less and 45 whose largest prime divisor is 13 or greater, so any of 11, 12, or 13 could be used for the second term, although the arithmetic average of the endpoints is commonly used. %p A124202 seq(Statistics:-Median([seq(max(numtheory:-factorset(n)),n=10^(d-1)..10^d-1)]),d=1..7); # _Robert Israel_, Dec 11 2015 %t A124202 f[n_] := Block[{k = If[n == 1, 1, 0], lst = {}, pt = 10^(n - 1)}, While[k < 9*pt, AppendTo[lst, FactorInteger[pt + k][[ -1, 1]]]; k++ ]; Median@ lst]; (* _Robert G. Wilson v_, Dec 14 2006 *) %o A124202 (GAUSS) %o A124202 n = 1; %o A124202 a = 2 | 3 | 2 | 5 | 3 | 7 | 2 | 3; %o A124202 meana = meanc(a); %o A124202 mediana = median(a); %o A124202 format /rdn 1,0; %o A124202 print n;; "-digit numbers:"; %o A124202 print " Median = ";; mediana; %o A124202 format /rdn 10,5; %o A124202 print " Mean = ";; meana; %o A124202 print; %o A124202 b = 1 | a; %o A124202 dim = 1; %o A124202 _01: wait; %o A124202 n = n+1; %o A124202 dim = 10*dim; %o A124202 a = b | zeros(9*dim,1); %o A124202 i = dim; %o A124202 do until i == 10*dim; %o A124202 if i == 2*floor(i/2); %o A124202 a[i] = a[i/2]; %o A124202 else; %o A124202 p = firstp(i); %o A124202 if p == i; %o A124202 a[i] = i; %o A124202 else; %o A124202 a[i] = a[i/p]; %o A124202 endif; %o A124202 endif; %o A124202 i = i+1; %o A124202 endo; %o A124202 b = a[dim:10*dim-1]; %o A124202 meana = meanc(b); %o A124202 mediana = median(b); %o A124202 format /rdn 1,0; %o A124202 print n;; "-digit numbers:"; %o A124202 print " Median = ";; mediana; %o A124202 format /rdn 10,5; %o A124202 print " Mean = ";; meana; %o A124202 print; %o A124202 b = a; %o A124202 goto _01; %o A124202 proc firstp(n); %o A124202 local i; %o A124202 i = 3; %o A124202 do until i > sqrt(n); %o A124202 if n == i*floor(n/i); %o A124202 retp(i); %o A124202 endif; %o A124202 i = i+2; %o A124202 endo; %o A124202 retp(n); %o A124202 endp; %o A124202 (MATLAB) %o A124202 P = primes(10^8); %o A124202 L = zeros(1,10^8); %o A124202 for p = P %o A124202 L([p:p:10^8]) = p; %o A124202 end %o A124202 A(1) = median(L(2:9)); %o A124202 for d = 2:8 %o A124202 A(d) = median(L(10^(d-1):10^d-1)); %o A124202 end %o A124202 A % _Robert Israel_, Dec 11 2015 %o A124202 (Python) %o A124202 from sympy import factorint %o A124202 from statistics import median %o A124202 def a(n): %o A124202 lb, ub = max(2, 10**(n-1)), 10**n %o A124202 return int(round(median([max(factorint(i)) for i in range(lb, ub)]))) %o A124202 print([a(n) for n in range(1, 6)]) # _Michael S. Branicky_, Mar 12 2021 %Y A124202 Cf. A006530, A046731, A126282. %K A124202 base,more,nonn %O A124202 1,1 %A A124202 Mark Thornquist (mthornqu(AT)fhcrc.org), Dec 07 2006 %E A124202 Edited by _Robert G. Wilson v_, Dec 14 2006 %E A124202 a(8) from _Robert Israel_, Dec 11 2015 %E A124202 a(9) from _Giovanni Resta_, Apr 19 2016