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.

This page as a plain text file.
%I A385685 #17 Jul 12 2025 08:34:13
%S A385685 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,
%T A385685 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,
%U A385685 1,2,3,1,1,2,1,1,2,1,1,2,3,4,1,1,2,1,1,2,1,1,2,3
%N A385685 Sequence where k is appended after every k! occurrences of 1, with multiple values following a 1 listed in order.
%C A385685 The frequencies of the terms follow the Poisson distribution with parameter value 1.
%C A385685 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!).
%H A385685 Jwalin Bhatt, <a href="/A385685/b385685.txt">Table of n, a(n) for n = 0..9999</a>
%H A385685 Wikipedia, <a href="https://en.wikipedia.org/wiki/Poisson_distribution">Poisson distribution</a>
%e A385685 Every 1 is followed by a 1 because 1! = 1,
%e A385685 after every (2!=2) ones we see a 2,
%e A385685 after every (3!=6) ones we see a 3 and so on.
%t A385685 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 *)
%o A385685 (Python)
%o A385685 from itertools import islice
%o A385685 from math import factorial
%o A385685 def poisson_distribution_generator():
%o A385685     num_ones, num_reached = 0, 1
%o A385685     while num_ones := num_ones+1:
%o A385685         yield 1
%o A385685         for num in range(2, num_reached+2):
%o A385685             if num_ones % factorial(num) == 0:
%o A385685                 yield num
%o A385685                 num_reached += num == num_reached+1
%o A385685 A385685 = list(islice(poisson_distribution_generator(), 120))
%Y A385685 Cf. A000142 (n!), A382093, A385686.
%K A385685 nonn
%O A385685 0,3
%A A385685 _Jwalin Bhatt_, Jul 06 2025