login
A sequence constructed by greedily sampling the Hermite distribution, with both parameters as 1, to minimize ratio discrepancy. The distribution indexing is adjusted to be strictly decreasing and support all positive integers.
4

%I #45 Mar 31 2026 08:51:38

%S 1,2,3,1,4,2,3,1,5,2,1,3,4,1,2,3,6,1,2,5,4,1,3,2,1,3,4,1,2,5,1,3,7,2,

%T 1,4,3,2,6,1,2,3,1,5,4,1,2,3,1,2,4,3,1,5,2,1,3,6,4,1,2,3,1,2,5,1,4,3,

%U 8,7,2,1,3,2,1,4,5,1,3,2,6,1,2,4,3,1,2

%N A sequence constructed by greedily sampling the Hermite distribution, with both parameters as 1, to minimize ratio discrepancy. The distribution indexing is adjusted to be strictly decreasing and support all positive integers.

%C 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.

%C The Hermite distribution used here is conditioned on being >=2, and then subtracting 1.

%C 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)!).

%C The arithmetic mean approaches Sum_{k>=1} k * p(k) = 2.9278062629... in the limit.

%C The geometric mean approaches Product_{k>=2} k ^ p(k) = 2.38445049699... in the limit.

%C 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

%H Jwalin Bhatt, <a href="/A393161/b393161.txt">Table of n, a(n) for n = 1..10000</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/D%27Hondt_method">D'Hondt method</a>.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Hermite_distribution">Hermite distribution</a>.

%e Let p(k) denote the probability of k and c(k) denote the count of occurrences of k so far.

%e 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.

%e Since p(k) is monotonic decreasing, we only need to compute c(k) once we see c(k-1).

%e | n | (c(1)+1)/p(1) | (c(2)+1)/p(2) | (c(3)+1)/p(3) | (c(4)+1)/p(4) | choice |

%e |---|---------------|---------------|---------------|---------------|--------|

%e | 1 | 3.592 | - | - | - | 1 |

%e | 2 | 7.185 | 4.619 | - | - | 2 |

%e | 3 | 7.185 | 9.238 | 5.173 | - | 3 |

%e | 4 | 7.185 | 9.238 | 10.346 | 7.983 | 1 |

%e | 5 | 10.778 | 9.238 | 10.346 | 7.983 | 4 |

%t pdf[i_] := HypergeometricPFQ[{-(i+1)/2, -i/2}, {}, 4] / (i+1)!

%t samplePDF[numCoeffs_] := Module[

%t {coeffs = {}, counts = {0}, minTime, minIndex, time},

%t Do[

%t minTime = Infinity;

%t Do[

%t time = (counts[[i]] + 1)/pdf[i];

%t If[time < minTime, minIndex = i; minTime = time],

%t {i, 1, Length[counts]}

%t ];

%t If[minIndex == Length[counts], AppendTo[counts, 0]];

%t counts[[minIndex]] += 1;

%t AppendTo[coeffs, minIndex],

%t {numCoeffs}

%t ];

%t coeffs

%t ]

%t A393161 = samplePDF[120]

%o (Python)

%o from math import factorial

%o from fractions import Fraction

%o def hermite(k):

%o return sum(Fraction(1, (factorial(i)*factorial(k+1-2*i))) for i in range(1+(k+1)//2))

%o def sample_hermite_distribution(num_coeffs):

%o coeffs, counts = [], [0]

%o for _ in range(num_coeffs):

%o min_time = float('infinity')

%o for i, count in enumerate(counts, start=1):

%o time = (count+1) / hermite(i)

%o if time < min_time:

%o min_index, min_time = i, time

%o if min_index == len(counts):

%o counts.append(0)

%o counts[min_index-1] += 1

%o coeffs.append(min_index)

%o return coeffs

%o A393161 = sample_hermite_distribution(120)

%Y Cf. A072334, A386016, A393100, A393663.

%K nonn

%O 1,2

%A _Jwalin Bhatt_, Mar 03 2026