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.

Showing 1-2 of 2 results.

A022786 Place where n-th 1 occurs in A023124.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 12, 15, 18, 22, 26, 31, 36, 41, 47, 53, 59, 66, 73, 80, 88, 96, 105, 114, 123, 133, 143, 153, 164, 175, 187, 199, 211, 224, 237, 250, 264, 278, 292, 307, 322, 338, 354, 370, 387, 404, 421, 439, 457, 476, 495, 514, 534, 554, 574
Offset: 1

Views

Author

Keywords

Extensions

An incorrect g.f. was deleted by N. J. A. Sloane, Sep 16 2009

A023123 Signature sequence of e (arrange the numbers i+j*x (i,j >= 1) in increasing order; the sequence of i's is the signature of x).

Original entry on oeis.org

1, 2, 3, 1, 4, 2, 5, 3, 6, 1, 4, 7, 2, 5, 8, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11, 3, 6, 9, 1, 12, 4, 7, 10, 2, 13, 5, 8, 11, 3, 14, 6, 9, 1, 12, 4, 15, 7, 10, 2, 13, 5, 16, 8, 11, 3, 14, 6, 17, 9, 1, 12, 4, 15, 7, 18, 10, 2, 13, 5, 16, 8, 19, 11, 3, 14, 6, 17, 9, 20, 1, 12, 4, 15, 7, 18, 10, 21, 2
Offset: 1

Views

Author

Keywords

Comments

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
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

References

  • Clark Kimberling, "Fractal Sequences and Interspersions", Ars Combinatoria, vol. 45 p 157 1997.

Crossrefs

Programs

  • Mathematica
    Quiet[Block[{$ContextPath}, Needs["Combinatorica`"]], {General::compat}]
    theta = E;
    sums = {0};
    cached = <||>;
    A023123[i_] := Module[{term, path, base},
      While[sums[[-1]] < i,
        term = sums[[-1]] + Floor[theta * (Length[sums] - 1)] + 1;
        AppendTo[sums, term];
        cached[term] = 1
      ];
      path = {i};
      While[Not[KeyExistsQ[cached, path[[-1]]]],
        AppendTo[path, path[[-1]] - Combinatorica`BinarySearch[sums, path[[-1]]] + 3/2];
      ];
      base = cached[path[[-1]]];
      MapIndexed[(cached[#1] = base + Length[path] - First[#2]) &, path];
      cached[i]
    ];
    Print[Table[A023123[i], {i, 1, 100}]]; (* Brady J. Garvin, Sep 13 2024 *)
  • Python
    from bisect import bisect
    from sympy import floor, E
    theta = E
    sums = [0]
    cached = {}
    def A023123(i):
        while sums[-1] < i:
            term = sums[-1] + floor(theta * (len(sums) - 1)) + 1
            sums.append(term)
            cached[term] = 1
        path = [i]
        while path[-1] not in cached:
            path.append(path[-1] - bisect(sums, path[-1]) + 1)
        base = cached[path[-1]]
        for offset, vertex in enumerate(reversed(path)):
            cached[vertex] = base + offset
        return cached[i]
    print([A023123(i) for i in range(1, 1001)])  # Brady J. Garvin, Sep 13 2024

Extensions

The a(47) term was missing. Corrected by T. D. Noe, Aug 12 2008
Showing 1-2 of 2 results.