login
A397557
A sequence constructed by greedily sampling the zeta distribution for parameter value 3 to minimize discrepancy.
2
1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1
OFFSET
1,4
COMMENTS
The probability mass function for this zeta distribution is given by p(i) = 1/(zeta(3)*i^3).
A general family of these distributions is given by p(i) = 1/(zeta(s)*i^s) where s > 1. This sequence is the s=3 case.
Properties change sharply at s=2, the geometric mean remains finite for all s but the arithmetic mean becomes finite for s > 2 and infinite for s <= 2.
| mean | 1 < s <= 2 | s > 2 |
| ---------- | ---------- | ------ |
| arithmetic | oo | finite |
| geometric | finite | finite |
The geometric mean approaches exp(-zeta'(3)/zeta(3)) = 1.1791840098089555... in the limit. In general, if the sequence was formed by every k^s occurrences, it would approach e^(-zeta'(s)/zeta(s)).
Unlike A381617, this sequence has a finite arithmetic mean, equal to zeta(2)/zeta(3) = 1.368432777... and in general for power s it equals zeta(s-1)/zeta(s).
LINKS
EXAMPLE
Let p(k) denote the probability of k and c(k) the number of occurrences of k among the first n-1 terms; the expected count among n terms is n*p(k). We pick the k maximizing n*p(k) - c(k).
| n | n*p(1) - c(1) | n*p(2) - c(2) | n*p(3) - c(3) | choice |
|---|---------------|---------------|---------------|--------|
| 1 | 0.831 | - | - | 1 |
| 2 | 0.663 | 0.207 | - | 1 |
| 3 | 0.495 | 0.311 | - | 1 |
| 4 | 0.327 | 0.415 | - | 2 |
| 5 | 1.159 | -0.480 | 0.154 | 1 |
| 6 | 0.991 | -0.376 | 0.184 | 1 |
MATHEMATICA
probCountDiff[j_, k_, count_] := k/(Zeta[3] j^3) - Lookup[count, j, 0]
samplePDF[n_] := Module[{coeffs, unreachedVal, counts, k, probCountDiffs, mostProbable},
coeffs = ConstantArray[0, n]; unreachedVal = 1; counts = <||>;
Do[probCountDiffs = Table[probCountDiff[i, k, counts], {i, 1, unreachedVal}];
mostProbable = First@FirstPosition[probCountDiffs, Max[probCountDiffs]];
If[mostProbable == unreachedVal, unreachedVal++]; coeffs[[k]] = mostProbable;
counts[mostProbable] = Lookup[counts, mostProbable, 0] + 1, {k, 1, n}]; coeffs]
A397557 = samplePDF[87]
PROG
(Python)
from sympy import zeta
def prob_count_diff(j, k, count):
return k/(zeta(3)*j**3) - count
def sample_zeta_distribution(num_coeffs):
coeffs, unreached_val, counts = [], 1, {}
for k in range(1, num_coeffs+1):
diffs = [prob_count_diff(i, k, counts.get(i, 0)) for i in range(1, unreached_val+1)]
most_probable = diffs.index(max(diffs)) + 1
unreached_val += most_probable == unreached_val
coeffs.append(most_probable)
counts[most_probable] = counts.get(most_probable, 0) + 1
return coeffs
A397557 = sample_zeta_distribution(87)
CROSSREFS
Sequence in context: A184097 A345932 A205399 * A135303 A036065 A082907
KEYWORD
nonn,new
AUTHOR
Jwalin Bhatt, Jun 30 2026
STATUS
approved