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 A288347 #32 May 06 2022 13:13:51 %S A288347 1,2,5,9,13,20,25,34,41,52,61,74,85,100,116,130,149,164,185,202,225, %T A288347 244,269,290,317,340,369,394,425,452,485,520,549,585,617,653,689,730, %U A288347 765,808,845,890,929,976,1017,1066,1109,1160,1205,1258,1305,1360,1409 %N A288347 Median of X^2 + Y^2 where X and Y are independent random variables with B(n, 1/2) distributions. %C A288347 Interpretation: Start at the origin, and flip a pair of coins. Move right one unit if the first coin is heads, and otherwise stay in place. Then move up one unit if the second coin is heads, and otherwise stay in place. This sequence gives your median squared-distance from the origin after n pairs of coin flips. %C A288347 Although a median of integers can be a half-integer, as an empirical observation only integers appear in this sequence. %C A288347 The mean of X^2 + Y^2 is (n^2+n)/2, or A000217. %C A288347 From _Robert Israel_, Oct 04 2017: (Start) %C A288347 To avoid the possibility of half-integer values, the median can be taken as the least integer v such that Probability(X^2 + Y^2 <= v) >= 1/2. %C A288347 All terms are in A001481. %C A288347 Using the Central Limit Theorem, 4*(X^2+Y^2)/n has approximately a noncentral chi-square distribution with 2 degrees of freedom and noncentrality parameter 2*n. Thus integral_{t=0..4*a(n)/n} exp(-n-t/2) BesselI(0,sqrt(2*n*t)) dt is approximately 1. %C A288347 Since a random variable not too far from normal has median approximately mu - gamma*sigma/6 where mu, sigma and gamma are the mean, standard deviation and skewness, we should expect a(n) to be approximately n^2/2 + n/4. %C A288347 (End) %H A288347 Robert Israel, <a href="/A288347/b288347.txt">Table of n, a(n) for n = 1..800</a> %p A288347 f:= proc(n) local S,P,i,j,q; %p A288347 S:= sort( [seq(seq([i,j],i=0..n),j=0..n)],(a,b) -> a[1]^2 + a[2]^2 < b[1]^2 + b[2]^2); %p A288347 P:= ListTools:-PartialSums(map(t -> binomial(n,t[1])*binomial(n,t[2])/2^(2*n), S)); %p A288347 q:= ListTools:-BinaryPlace(P,1/2); %p A288347 if P[q] = 1/2 then S[q][1]^2 + S[q][2]^2 %p A288347 else S[q+1][1]^2 + S[q+1][2]^2 %p A288347 fi %p A288347 end proc: %p A288347 map(f, [$1..80]); # _Robert Israel_, Oct 04 2017 %t A288347 Squared[x_] := x^2; %t A288347 WeightsMatrix[n_] := Table[Binomial[n, i] Binomial[n, j], {i, 0, n}, {j, 0, n}]/2^(2 n); %t A288347 ValuesMatrix[n_, f_] := Table[f[i] + f[j], {i, 0, n}, {j, 0, n}]; %t A288347 Distribution[n_, f_] := EmpiricalDistribution[Flatten[WeightsMatrix[n]] -> Flatten[ValuesMatrix[n, f]]]; %t A288347 NewMedian[n_, f_] := Mean[Quantile[Distribution[n, f], {1/2, 1/2 + 1/2^(2 n)}]]; %t A288347 Table[NewMedian[n, Squared], {n, 53}] %Y A288347 Cf. A288416, which is similar, with shifted coordinates; and also A288346, which is multiplicative rather than additive. %K A288347 nonn %O A288347 1,2 %A A288347 _Matt Frank_, Jun 08 2017