login
A381617
A sequence constructed by greedily sampling the zeta distribution for parameter value 2 to minimize discrepancy.
7
1, 2, 1, 1, 3, 1, 4, 1, 1, 2, 1, 1, 5, 1, 2, 1, 1, 6, 1, 3, 1, 1, 2, 1, 7, 1, 1, 8, 1, 2, 1, 1, 4, 1, 3, 1, 2, 1, 1, 1, 9, 1, 2, 1, 1, 10, 1, 2, 1, 1, 3, 1, 5, 1, 1, 2, 1, 11, 1, 1, 4, 1, 2, 1, 1, 3, 1, 1, 2, 1, 12, 1, 1, 13, 1, 2, 1, 1, 3, 1, 6, 1, 2, 1, 1, 1, 4, 1, 2, 1, 1, 14
OFFSET
1,2
COMMENTS
The zeta distribution probability mass function is p(i) = 1/(zeta(2)*i^2).
From Jwalin Bhatt, Jun 09 2026: (Start)
A general family of these distributions is given by p(i) = 1/(zeta(s)*i^s) where s > 1. This sequence is the s=2 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 arithmetic mean of this sequence diverges to infinity but for general power s in the family above, it approaches zeta(s-1)/zeta(s) in the limit for s>2.
The geometric mean of this sequence approaches Product_{i>=2} i^(1/(zeta(2)*i^2)) = exp(-zeta'(2)/zeta(2)) = 1.768198078153... (A381456) in the limit and for general power s in the family above it approaches exp(-zeta'(s)/zeta(s)) in the limit. (End)
LINKS
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; then the expected number of occurrences of k among n random terms is given by n*p(k).
We subtract the actual occurrences c(k) from the expected occurrences and pick the one with the highest value.
| n | n*p(1) - c(1) | n*p(2) - c(2) | n*p(3) - c(3) | choice |
|---|---------------|---------------|---------------|--------|
| 1 | 0.607 | - | - | 1 |
| 2 | 0.215 | 0.303 | - | 2 |
| 3 | 0.823 | -0.544 | 0.202 | 1 |
| 4 | 0.431 | -0.392 | 0.270 | 1 |
| 5 | 0.039 | -0.240 | 0.337 | 3 |
MATHEMATICA
probCountDiff[j_, k_, count_] := k/(Zeta[2] j^2) - 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]
A381617 = samplePDF[120]
PROG
(Python)
from mpmath import iv
zeta2 = iv.pi**2/6
def prob_count_diff(j, k, count):
return k/(zeta2*j*j) - count
def sample_zeta_distribution(num_coeffs):
coeffs, unreached_val, counts = [], 1, {}
for k in range(1, num_coeffs+1):
prob_count_diffs = [prob_count_diff(i, k, counts.get(i, 0)) for i in range(1, unreached_val+1)]
most_probable = prob_count_diffs.index(max(prob_count_diffs)) + 1
unreached_val += most_probable == unreached_val
coeffs.append(most_probable)
counts[most_probable] = counts.get(most_probable, 0) + 1
return coeffs
A381617 = sample_zeta_distribution(120) # Jwalin Bhatt, Dec 18 2025
CROSSREFS
Sequence in context: A089141 A336084 A375128 * A396506 A386904 A245717
KEYWORD
nonn,changed
AUTHOR
Jwalin Bhatt, Mar 10 2025
STATUS
approved