cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A382093 Sequence where k is appended after every (k-1)! occurrences of 1, with multiple values following a 1 listed in order.

Original entry on oeis.org

1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 5, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2
Offset: 1

Views

Author

Jwalin Bhatt, Mar 25 2025

Keywords

Comments

The frequencies of the terms follow the Poisson distribution with parameter value 1.
The geometric mean approaches A382095 in the limit. In general, for parameter value p it approaches Product_{k>=2} k^(((p^(k-1))*(e^(-p)))/(k-1)!).

Examples

			Every 1 is followed by a 2 because (2-1)! = 1,
after every (2!=2) ones we see a 3,
after every (3!=6) ones we see a 4 and so on.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    from math import factorial
    def poisson_distribution_generator():
        num_ones, num_reached = 0, 1
        while num_ones := num_ones+1:
            yield 1
            for num in range(2, num_reached+2):
                if num_ones % factorial(num-1) == 0:
                    yield num
                    num_reached += num == num_reached+1
    A382093 = list(islice(poisson_distribution_generator(), 120))

A383238 A sequence constructed by greedily sampling the Poisson distribution for parameter value 1, 1/(e*(i-1)!) to minimize discrepancy selecting the smallest value in case of ties.

Original entry on oeis.org

1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 1, 2, 3, 4, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 5, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 2, 1, 2, 3, 1, 2, 6, 1, 2, 3, 1, 2
Offset: 1

Views

Author

Jwalin Bhatt, Apr 20 2025

Keywords

Comments

The geometric mean approaches A382095 = exp(Sum_{k>=2} log(k)/(k-1)!) in the limit.

Examples

			Let p(k) denote the probability of k and c(k) denote the count of occurrences of k so far, then the expected occurrences of k at n-th step are 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.367     |     0.367     |     0.183     |   1    |
| 2 |    -0.264     |     0.735     |     0.367     |   2    |
| 3 |     0.103     |     0.103     |     0.551     |   3    |
| 4 |     0.471     |     0.471     |    -0.264     |   1    |
| 5 |    -0.160     |     0.839     |    -0.080     |   2    |
		

Crossrefs

Programs

  • Mathematica
    probCountDiff[j_,k_,count_]:=N[k/(E*Factorial[j-1])]-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]
    A383238=samplePDF[120]

A385686 Decimal expansion of exp((Sum_{k>=2} log(k)/k!)/(e-1)).

Original entry on oeis.org

1, 4, 2, 1, 0, 3, 7, 9, 5, 9, 7, 3, 1, 9, 6, 0, 7, 1, 5, 3, 3, 7, 8, 1, 4, 4, 8, 9, 0, 5, 9, 2, 8, 5, 6, 9, 5, 3, 9, 8, 2, 5, 7, 1, 7, 4, 2, 9, 3, 2, 0, 0, 7, 8, 6, 8, 1, 0, 2, 8, 0, 5, 1, 8, 1, 5, 8, 2, 2, 1, 6, 1, 7, 5, 8, 0, 8, 3, 0, 7, 1, 7, 9, 7, 5
Offset: 1

Views

Author

Jwalin Bhatt, Jul 06 2025

Keywords

Comments

The geometric mean of the Poisson distribution with parameter value 1 (A385685) approaches this constant.

Examples

			1.4210379597319607153378144890592856953982...
		

Crossrefs

Programs

  • Mathematica
    N[Exp [Sum[Log[i]/Factorial[i], {i, 2, Infinity}] / (E-1) ], 120]
  • PARI
    prodinf(k=2, k^(1/k!))^(1/(exp(1)-1))

Formula

Equals exp((Sum_{k>=2} log(k)/k!)/(e-1)).
Equals (Product_{k>=2} k^(1/k!)) ^ (1/(e-1)).
From Vaclav Kotesovec, Jul 08 2025: (Start)
Equals exp(A306243/(exp(1) - 1)).
Equals A296301^(1/(exp(1) - 1)). (End)
Showing 1-3 of 3 results.