OFFSET
1,2
COMMENTS
The original distribution, which supports all integers including 0, is given by PDF p(k) = (Sum_{i=0..floor(k/2)} 1/(i!*(k-2*i)!)) / e^2 = 2F0([-k/2, (1-k)/2], [], 4) / (e^2 * k!). It has p(0)=p(1)=1/e^2 which is less than p(2). From p(2) onwards it is strictly decreasing hence we can shift and adjust the distribution to only consider that.
The Hermite distribution used here is conditioned on being >=2, and then subtracting 1.
The distribution is given by PDF p(k) = (Sum_{i=0..ceiling(k/2)} 1/(i!*(k+1-2*i)!)) / (e^2-2) = 2F0([-(k+1)/2, -k/2], [], 4) / ((e^2 - 2)*(k+1)!).
The arithmetic mean approaches Sum_{k>=1} k * p(k) = 2.9278062629... in the limit.
The geometric mean approaches Product_{k>=2} k ^ p(k) = 2.38445049699... in the limit.
This sequence is generated by the D'Hondt (or Jefferson) apportionment method for the given distribution (choosing the smallest element in case of ties). - Pontus von Brömssen, Mar 30 2026
LINKS
Jwalin Bhatt, Table of n, a(n) for n = 1..10000
Wikipedia, D'Hondt method.
Wikipedia, Hermite distribution.
EXAMPLE
Let p(k) denote the probability of k and c(k) denote the count of occurrences of k so far.
We take the ratio of the actual occurrences c(k)+1 to the probability and pick the one with the lowest value. In case of ties pick the smallest k.
Since p(k) is monotonic decreasing, we only need to compute c(k) once we see c(k-1).
| n | (c(1)+1)/p(1) | (c(2)+1)/p(2) | (c(3)+1)/p(3) | (c(4)+1)/p(4) | choice |
|---|---------------|---------------|---------------|---------------|--------|
| 1 | 3.592 | - | - | - | 1 |
| 2 | 7.185 | 4.619 | - | - | 2 |
| 3 | 7.185 | 9.238 | 5.173 | - | 3 |
| 4 | 7.185 | 9.238 | 10.346 | 7.983 | 1 |
| 5 | 10.778 | 9.238 | 10.346 | 7.983 | 4 |
MATHEMATICA
pdf[i_] := HypergeometricPFQ[{-(i+1)/2, -i/2}, {}, 4] / (i+1)!
samplePDF[numCoeffs_] := Module[
{coeffs = {}, counts = {0}, minTime, minIndex, time},
Do[
minTime = Infinity;
Do[
time = (counts[[i]] + 1)/pdf[i];
If[time < minTime, minIndex = i; minTime = time],
{i, 1, Length[counts]}
];
If[minIndex == Length[counts], AppendTo[counts, 0]];
counts[[minIndex]] += 1;
AppendTo[coeffs, minIndex],
{numCoeffs}
];
coeffs
]
A393161 = samplePDF[120]
PROG
(Python)
from math import factorial
from fractions import Fraction
def hermite(k):
return sum(Fraction(1, (factorial(i)*factorial(k+1-2*i))) for i in range(1+(k+1)//2))
def sample_hermite_distribution(num_coeffs):
coeffs, counts = [], [0]
for _ in range(num_coeffs):
min_time = float('infinity')
for i, count in enumerate(counts, start=1):
time = (count+1) / hermite(i)
if time < min_time:
min_index, min_time = i, time
if min_index == len(counts):
counts.append(0)
counts[min_index-1] += 1
coeffs.append(min_index)
return coeffs
A393161 = sample_hermite_distribution(120)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jwalin Bhatt, Mar 03 2026
STATUS
approved
