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 A386016 #17 Aug 22 2025 17:19:39 %S A386016 1,1,1,2,1,1,1,2,1,3,1,1,2,1,1,1,1,2,4,1,3,1,1,2,1,1,1,2,1,1,3,1,5,1, %T A386016 2,1,1,1,2,4,1,1,3,1,2,1,1,1,2,1,1,1,1,6,3,2,1,1,1,2,1,4,1,1,2,1,3,1, %U A386016 1,5,1,2,1,1,1,2,1,3,1,1,2,1,4,1,1,7 %N A386016 A sequence constructed by greedily sampling the Borel distribution for parameter value 1/2 to minimize ratio discrepancy. %C A386016 The geometric mean approaches A386009 in the limit. %C A386016 The Borel distribution has PDF p(i) = (i/2)^(i-1) / (exp(i/2)*i!). %H A386016 Jwalin Bhatt, <a href="/A386016/b386016.txt">Table of n, a(n) for n = 1..10000</a> %H A386016 Wikipedia, <a href="https://en.wikipedia.org/wiki/Borel_distribution">Borel distribution</a> %e A386016 Let p(k) denote the probability of k and c(k) denote the count of occurrences of k so far. %e A386016 We take the ratio of the actual occurrences c(k)+1 to the probability and pick the one with the lowest value. %e A386016 Since p(k) is monotonic decreasing, we only need to compute c(k) once we see c(k-1). %e A386016 | n | (c(1)+1)/p(1) | (c(2)+1)/p(2) | (c(3)+1)/p(3) | choice | %e A386016 |---|---------------|---------------|---------------|--------| %e A386016 | 1 | 1.648 | - | - | 1 | %e A386016 | 2 | 3.297 | 5.436 | - | 1 | %e A386016 | 3 | 4.946 | 5.436 | - | 1 | %e A386016 | 4 | 6.594 | 5.436 | - | 2 | %e A386016 | 5 | 6.594 | 10.873 | 11.951 | 1 | %t A386016 pdf[i_] := ((i/2)^(i - 1))/((E^(i/2)) * Factorial[i]) %t A386016 samplePDF[numCoeffs_] := Module[ %t A386016 {coeffs = {}, counts = {0}, minTime, minIndex, time}, %t A386016 Do[ %t A386016 minTime = Infinity; %t A386016 Do[ %t A386016 time = (counts[[i]] + 1)/pdf[i]; %t A386016 If[time < minTime, minIndex = i; minTime = time], %t A386016 {i, 1, Length[counts]} %t A386016 ]; %t A386016 If[minIndex == Length[counts], AppendTo[counts, 0]]; %t A386016 counts[[minIndex]] += 1; %t A386016 AppendTo[coeffs, minIndex], %t A386016 {numCoeffs} %t A386016 ]; %t A386016 coeffs %t A386016 ] %t A386016 A386016 = samplePDF[120] %Y A386016 Cf. A386009, A386904. %K A386016 nonn,changed %O A386016 1,4 %A A386016 _Jwalin Bhatt_, Jul 14 2025