%I #30 Oct 16 2024 21:49:33
%S 1,1,1,2,1,2,1,2,1,3,2,1,3,2,1,3,2,1,4,3,2,1,4,3,2,1,4,3,2,5,1,4,3,2,
%T 5,1,4,3,2,5,1,4,3,6,2,5,1,4,3,6,2,5,1,4,3,6,2,5,1,4,7,3,6,2,5,1,4,7,
%U 3,6,2,5,1,4,7,3,6,2,5,1,8,4,7,3,6,2,5,1,8,4,7,3,6,2,5,1,8,4,7,3
%N Signature sequence of 1/e (arrange the numbers i+j*x (i,j >= 1) in increasing order; the sequence of i's is the signature of x).
%C Arrange the numbers i+j*e (i,j >= 1) in increasing order; this sequence is the sequence of j's. - _Michel Marcus_, Dec 18 2021
%C If one deletes the first occurrence of 1, the first occurrence of 2, the first occurrence of 3, etc., then the sequence is unchanged. - _Brady J. Garvin_, Sep 11 2024
%C Any signature sequence A is closely related to the partial sums of the corresponding homogeneous Beatty sequence: Let Q(d) = d + the sum from g=0 to g=d-1 of floor(theta * g) and Qinv(i) = the maximum integer d such that Q(d) <= i. If there is some d for which Q(d) = i, then A_i = 1. Otherwise, A_i = A_{i - Qinv(i)} + 1. - _Brady J. Garvin_, Sep 13 2024
%D J.-P. Delahaye, Des suites fractales d’entiers, Pour la Science, No. 531 January 2022. Sequence h) p. 82.
%D Clark Kimberling, "Fractal Sequences and Interspersions", Ars Combinatoria, vol. 45 p 157 1997.
%H T. D. Noe, <a href="/A023124/b023124.txt">Table of n, a(n) for n=1..1000</a>
%H Clark Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/intersp.html">Interspersions</a>
%H <a href="/index/Si#signature_sequences">Index entries for sequences related to signature sequences</a>
%t Quiet[Block[{$ContextPath}, Needs["Combinatorica`"]], {General::compat}]
%t theta = 1 / E;
%t sums = {0};
%t cached = <||>;
%t A023124[i_] := Module[{term, path, base},
%t While[sums[[-1]] < i,
%t term = sums[[-1]] + Floor[theta * (Length[sums] - 1)] + 1;
%t AppendTo[sums, term];
%t cached[term] = 1
%t ];
%t path = {i};
%t While[Not[KeyExistsQ[cached, path[[-1]]]],
%t AppendTo[path, path[[-1]] - Combinatorica`BinarySearch[sums, path[[-1]]] + 3/2];
%t ];
%t base = cached[path[[-1]]];
%t MapIndexed[(cached[#1] = base + Length[path] - First[#2]) &, path];
%t cached[i]
%t ];
%t Print[Table[A023124[i], {i, 1, 100}]]; (* _Brady J. Garvin_, Sep 13 2024 *)
%o (Python)
%o from bisect import bisect
%o from sympy import floor, E
%o theta = 1 / E
%o sums = [0]
%o cached = {}
%o def A023124(i):
%o while sums[-1] < i:
%o term = sums[-1] + floor(theta * (len(sums) - 1)) + 1
%o sums.append(term)
%o cached[term] = 1
%o path = [i]
%o while path[-1] not in cached:
%o path.append(path[-1] - bisect(sums, path[-1]) + 1)
%o base = cached[path[-1]]
%o for offset, vertex in enumerate(reversed(path)):
%o cached[vertex] = base + offset
%o return cached[i]
%o print([A023124(i) for i in range(1, 1001)]) # _Brady J. Garvin_, Sep 13 2024
%Y Cf. A001113, A023123, A032634.
%K nonn,easy,nice,eigen,changed
%O 1,4
%A _Clark Kimberling_