cp's OEIS Frontend

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.

A385873 A sequence constructed by greedily sampling the Poisson distribution for parameter value 1 so as to minimize discrepancy.

This page as a plain text file.
%I A385873 #20 Jul 29 2025 00:18:37
%S A385873 1,2,1,3,1,2,1,1,2,1,1,2,1,3,1,2,1,1,2,1,4,1,2,1,1,2,1,3,1,2,1,1,2,1,
%T A385873 3,1,2,1,1,2,1,1,2,1,3,1,2,1,1,2,1,1,2,1,3,1,2,1,4,1,2,1,1,2,1,1,3,2,
%U A385873 1,1,2,1,1,2,1,3,1,2,1,1,2,1,5,1,2,1,1,2,1,3,1,2,1,1,2,1,1,2,1,3,1,2,1,1,2,1,4
%N A385873 A sequence constructed by greedily sampling the Poisson distribution for parameter value 1 so as to minimize discrepancy.
%C A385873 The geometric mean approaches A385686 = exp((Sum_{k>=2} log(k)/k!)/(e-1)) in the limit.
%C A385873 The Poisson distribution used here is p(i) = 1/((e-1)*i!).
%H A385873 Jwalin Bhatt, <a href="/A385873/b385873.txt">Table of n, a(n) for n = 1..10000</a>
%H A385873 Wikipedia, <a href="https://en.wikipedia.org/wiki/Poisson_distribution">Poisson distribution</a>
%e A385873 Let p(k) denote the probability of k and c(k) denote the number of occurrences of k among the first n-1 terms; then the expected number of occurrences of k among n random terms is given by n*p(k).
%e A385873 We subtract the actual occurrences c(k) from the expected occurrences and pick the one with the highest value.
%e A385873 | n | n*p(1) - c(1) | n*p(2) - c(2) | n*p(3) - c(3) | choice |
%e A385873 |---|---------------|---------------|---------------|--------|
%e A385873 | 1 |     0.581     |     0.290     |     0.096     |   1    |
%e A385873 | 2 |     0.163     |     0.581     |     0.193     |   2    |
%e A385873 | 3 |     0.745     |    -0.127     |     0.290     |   1    |
%e A385873 | 4 |     0.327     |     0.163     |     0.387     |   3    |
%e A385873 | 5 |     0.909     |     0.454     |    -0.515     |   1    |
%t A385873 probCountDiff[j_, k_, count_]:=N[k/((E-1)*Factorial[j])]-Lookup[count, j, 0]
%t A385873 samplePDF[n_]:=Module[{coeffs, unreachedVal, counts, k, probCountDiffs, mostProbable},
%t A385873   coeffs=ConstantArray[0, n]; unreachedVal=1; counts=<||>;
%t A385873   Do[probCountDiffs=Table[probCountDiff[i, k, counts], {i, 1, unreachedVal}];
%t A385873     mostProbable=First@FirstPosition[probCountDiffs, Max[probCountDiffs]];
%t A385873     If[mostProbable==unreachedVal, unreachedVal++]; coeffs[[k]]=mostProbable;
%t A385873     counts[mostProbable]=Lookup[counts, mostProbable, 0]+1; , {k, 1, n}]; coeffs]
%t A385873 A385873=samplePDF[120]
%Y A385873 Cf. A383238, A385685, A385686.
%K A385873 nonn
%O A385873 1,2
%A A385873 _Jwalin Bhatt_, Jul 11 2025