OFFSET
1,4
COMMENTS
The pdf of the sequence is the probability to see i as the remainder when you divide 1,2,3... with a random number from [1,10].
The respective probabilities are:
p(0) = 7381/25200 = 0.292896...
p(1) = 4861/25200 = 0.192896...
p(2) = 3601/25200 = 0.142896...
p(3) = 2761/25200 = 0.109563...
p(4) = 2131/25200 = 0.084563...
p(5) = 1627/25200 = 0.064563...
p(6) = 1207/25200 = 0.047896...
p(7) = 121/3600 = 0.033611...
p(8) = 19/900 = 0.021111...
p(9) = 1/100 = 0.01
The sequence repeats after 25200 terms. If the random number is picked from [1,n] the period of the sequence is given by n*lcm{1,2,...,n} (A081528).
The arithmetic mean of this sequence is 2.25.
For a sequence with length n, the n-th root of the product of nonzero terms is (2**(5333/12600))*(3**(559/3150))*(5**(1627/25200))*(7**(121/3600)) which is 1.9302557640832...
From Pontus von Brömssen, Mar 28 2026: (Start)
In case of ties, the smallest candidate value is chosen.
This sequence is generated by the D'Hondt (or Jefferson) apportionment method for the given distribution (choosing the smallest element in case of ties).
(End)
LINKS
Jwalin Bhatt, Table of n, a(n) for n = 1..25200
Wikipedia, D'Hondt method.
EXAMPLE
Let p(k) denote the probability of k and c(k) denote the number of occurrences of k among the first n-1 terms.
We take the ratio of the actual occurrences c(k)+1 to the probability and pick the one with the lowest value.
Since p(k) is monotonic decreasing, we only need to compute c(k) once we see c(k-1).
| n | (c(0)+1)/p(0) | (c(1)+1)/p(1) | (c(2)+1)/p(2) | choice |
|---|---------------|---------------|---------------|--------|
| 1 | 3.414 | - | - | 0 |
| 2 | 6.828 | 5.181 | - | 1 |
| 3 | 6.828 | 10.362 | 6.998 | 0 |
| 4 | 10.242 | 10.362 | 6.998 | 2 |
.
The first tie occurs for n = 203: Among the first 202 terms, 0 occurs c(0) = 60 times and 7 occurs c(7) = 6 times, so (c(0)+1)/p(0) = (c(7)+1)/p(7) = 25200/121 and this is the smallest such value at this stage. By the tiebreaking rule, a(203) = 0. - Pontus von Brömssen, Mar 28 2026
MATHEMATICA
samplePDF[numCoeffs_] := Module[{coeffs, counts},
coeffs = {}; counts = ConstantArray[0, 10];
Do[
minTime = Infinity;
Do[
time = 10*(counts[[i]] + 1)/(HarmonicNumber[10] - HarmonicNumber[i - 1]);
If[time < minTime, minIndex = i; minTime = time], {i, 1, 10}];
counts[[minIndex]] += 1;
coeffs = Append[coeffs, minIndex - 1],
{numCoeffs}
];
coeffs
]
A386950 = samplePDF[120]
PROG
(Python)
from sympy import harmonic
def sample_pdf(num_coeffs):
coeffs, counts = [], [0]*10
for _ in range(num_coeffs):
min_time = float('inf')
for i, count in enumerate(counts):
time = 10*(count+1) / (harmonic(10)-harmonic(i))
if time < min_time:
min_index, min_time = i, time
counts[min_index] += 1
coeffs.append(min_index)
return coeffs
A386950 = sample_pdf(120)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jwalin Bhatt, Aug 10 2025
STATUS
approved
