login
A394540
Sequence where, for every step t starting from 2, k is appended if t is a multiple of s(k-1), where s is Sylvester's sequence (A000058). If multiple numbers trigger on the same step, they are appended in increasing order.
2
1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 1, 2, 3, 4, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 1, 2, 3, 1, 4, 2, 1
OFFSET
1,2
COMMENTS
The density of k in this sequence is 1/s(k-1). This can be viewed as a probability mass function since Sum_{k>0} 1/s(k-1) = 1.
The arithmetic mean approaches Sum_{k>0} k/s(k-1) = 1.69103020... in the limit.
The geometric mean approaches Product_{k>1} k^(1/s(k-1)) = 1.523673650289... in the limit.
The sequence is generated by the D'Hondt (or Jefferson) apportionment method applied to the probability mass function above. - Pontus von Brömssen, Apr 20 2026
LINKS
EXAMPLE
At step t=2, we append a 1 because 2 is a multiple of s(0)=2.
At step t=3, we append a 2 because 3 is a multiple of s(1)=3.
At step t=4, we append a 1 because 4 is a multiple of s(0)=2.
At step t=6, we append a 1 and then 2 because 6 is a multiple of both 2 and 3.
At step t=7, we append a 3 because 7 is a multiple of s(2)=7.
MATHEMATICA
seq[len_] := Module[{n = 1, m = 1, c = 0, v = {}, s}, s[0] = 2; s[k_] := s[k] = s[k - 1]^2 - s[k - 1] + 1; While[c < len, n++; Do[If[Divisible[n, s[i - 1]], AppendTo[v, i]; c++; If[i == m + 1, m++]], {i, m + 1}]]; v]; seq[100] (* Amiram Eldar, Mar 24 2026 *)
PROG
(Python)
from itertools import islice
def sylvester(k):
if k == 0: return 2
s = sylvester(k-1)
return s*s - s + 1
def sample_sylvester_distribution():
n, num_reached = 1, 1
while n := n+1:
for num in range(1, num_reached+2):
if n % sylvester(num-1) == 0:
yield num
num_reached += num == num_reached+1
A394540 = list(islice(sample_sylvester_distribution(), 120))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jwalin Bhatt, Mar 24 2026
STATUS
approved