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.
%I A023124 #30 Oct 16 2024 21:49:33 %S A023124 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 A023124 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 A023124 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 A023124 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 A023124 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 A023124 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 A023124 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 A023124 J.-P. Delahaye, Des suites fractales d’entiers, Pour la Science, No. 531 January 2022. Sequence h) p. 82. %D A023124 Clark Kimberling, "Fractal Sequences and Interspersions", Ars Combinatoria, vol. 45 p 157 1997. %H A023124 T. D. Noe, <a href="/A023124/b023124.txt">Table of n, a(n) for n=1..1000</a> %H A023124 Clark Kimberling, <a href="http://faculty.evansville.edu/ck6/integer/intersp.html">Interspersions</a> %H A023124 <a href="/index/Si#signature_sequences">Index entries for sequences related to signature sequences</a> %t A023124 Quiet[Block[{$ContextPath}, Needs["Combinatorica`"]], {General::compat}] %t A023124 theta = 1 / E; %t A023124 sums = {0}; %t A023124 cached = <||>; %t A023124 A023124[i_] := Module[{term, path, base}, %t A023124 While[sums[[-1]] < i, %t A023124 term = sums[[-1]] + Floor[theta * (Length[sums] - 1)] + 1; %t A023124 AppendTo[sums, term]; %t A023124 cached[term] = 1 %t A023124 ]; %t A023124 path = {i}; %t A023124 While[Not[KeyExistsQ[cached, path[[-1]]]], %t A023124 AppendTo[path, path[[-1]] - Combinatorica`BinarySearch[sums, path[[-1]]] + 3/2]; %t A023124 ]; %t A023124 base = cached[path[[-1]]]; %t A023124 MapIndexed[(cached[#1] = base + Length[path] - First[#2]) &, path]; %t A023124 cached[i] %t A023124 ]; %t A023124 Print[Table[A023124[i], {i, 1, 100}]]; (* _Brady J. Garvin_, Sep 13 2024 *) %o A023124 (Python) %o A023124 from bisect import bisect %o A023124 from sympy import floor, E %o A023124 theta = 1 / E %o A023124 sums = [0] %o A023124 cached = {} %o A023124 def A023124(i): %o A023124 while sums[-1] < i: %o A023124 term = sums[-1] + floor(theta * (len(sums) - 1)) + 1 %o A023124 sums.append(term) %o A023124 cached[term] = 1 %o A023124 path = [i] %o A023124 while path[-1] not in cached: %o A023124 path.append(path[-1] - bisect(sums, path[-1]) + 1) %o A023124 base = cached[path[-1]] %o A023124 for offset, vertex in enumerate(reversed(path)): %o A023124 cached[vertex] = base + offset %o A023124 return cached[i] %o A023124 print([A023124(i) for i in range(1, 1001)]) # _Brady J. Garvin_, Sep 13 2024 %Y A023124 Cf. A001113, A023123, A032634. %K A023124 nonn,easy,nice,eigen %O A023124 1,4 %A A023124 _Clark Kimberling_