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.

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

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 4, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 4, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3
Offset: 0

Views

Author

Jwalin Bhatt, Jul 06 2025

Keywords

Comments

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

Examples

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

Crossrefs

Cf. A000142 (n!), A382093, A385686.

Programs

  • Mathematica
    A385685[n_] := Module[{N1 = 0,NR= 1, result = {},i=1}, While[Length[result] < n,N1++;AppendTo[result, 1]; Do[If[Mod[N1, Factorial[k]] == 0,    AppendTo[result, k];f[k == NR + 1, NR++]],{k, 2, NR + 1}];If[Length[result] > n, result = Take[result, n]]];result];A385685[92] (* James C. McMahon, Jul 11 2025 *)
  • 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) == 0:
                    yield num
                    num_reached += num == num_reached+1
    A385685 = list(islice(poisson_distribution_generator(), 120))