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-3 of 3 results.

A022785 Place where n-th 1 occurs in A023123.

Original entry on oeis.org

1, 4, 10, 19, 30, 44, 61, 81, 103, 128, 156, 186, 219, 255, 294, 335, 379, 426, 475, 527, 582, 640, 700, 763, 829, 897, 968, 1042, 1119, 1198, 1280, 1365, 1452, 1542, 1635, 1731, 1829, 1930, 2034, 2141, 2250, 2362, 2477, 2594, 2714, 2837, 2963
Offset: 1

Views

Author

Keywords

Programs

  • PARI
    a(n)=1+sum(k=1,n-1,ceil(exp(1)*k)) \\ Benoit Cloitre, Jan 24 2009

Formula

a(n) = 1 + Sum_{k=1..n-1} ceiling(e*k). - Benoit Cloitre, Jan 24 2009

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Comments

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

  • J.-P. Delahaye, Des suites fractales d’entiers, Pour la Science, No. 531 January 2022. Sequence h) p. 82.
  • Clark Kimberling, "Fractal Sequences and Interspersions", Ars Combinatoria, vol. 45 p 157 1997.

Crossrefs

Programs

  • Mathematica
    Quiet[Block[{$ContextPath}, Needs["Combinatorica`"]], {General::compat}]
    theta = 1 / E;
    sums = {0};
    cached = <||>;
    A023124[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[A023124[i], {i, 1, 100}]]; (* Brady J. Garvin, Sep 13 2024 *)
  • Python
    from bisect import bisect
    from sympy import floor, E
    theta = 1 / E
    sums = [0]
    cached = {}
    def A023124(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([A023124(i) for i in range(1, 1001)])  # Brady J. Garvin, Sep 13 2024

A283943 Interspersion of the signature sequence of e (a rectangular array, by antidiagonals).

Original entry on oeis.org

1, 4, 2, 10, 6, 3, 19, 13, 8, 5, 30, 23, 16, 11, 7, 44, 35, 27, 20, 14, 9, 61, 50, 40, 32, 24, 17, 12, 81, 68, 56, 46, 37, 28, 21, 15, 103, 89, 75, 63, 52, 42, 33, 25, 18, 128, 112, 97, 83, 70, 58, 48, 38, 29, 22, 156, 138, 121, 106, 91, 77, 65, 54, 43, 34
Offset: 1

Views

Author

Clark Kimberling, Mar 26 2017

Keywords

Comments

Row n is the ordered sequence of numbers k such that A023123(k) = n. As a sequence, A283943 is a permutation of the positive integers. This is a transposable interspersion; i.e., every row intersperses all other rows, and every column intersperses all other columns.

Examples

			Northwest corner:
  1  4   10  19  30  44  61  81   103
  2  6   13  23  35  50  68  89   112
  3  8   16  27  40  56  75  97   121
  5  11  20  32  46  63  83  106  131
  7  14  24  37  52  70  91  115  141
  9  17  28  42  58  77  99  124  151
		

Crossrefs

Programs

  • Mathematica
    r = E; z = 100; s[0] = 1; s[n_] := s[n] = s[n - 1] + 1 + Floor[n*r];
    u = Table[n + 1 + Sum[Floor[(n - k)/r], {k, 0, n}], {n, 0, z}] (* A022786, col 1 of A283943 *)
    v = Table[s[n], {n, 0, z}] (* A022785, row 1 of A283943 *)
    w[i_, j_] := u[[i]] + v[[j]] + (i - 1)*(j - 1) - 1;
    Grid[Table[w[i, j], {i, 1, 10}, {j, 1, 10}]] (* A283943, array *)
    Flatten[Table[w[k, n - k + 1], {n, 1, 20}, {k, 1, n}]] (* A283943, sequence *)
  • PARI
    \\ Produces the triangle when the array is read by antidiagonals
    r = exp(1);
    z = 100;
    s(n) = if(n<1, 1, s(n - 1) + 1 + floor(n*r));
    p(n) = n + 1 + sum(k=0, n, floor((n - k)/r));
    u = v = vector(z + 1);
    for(n=1, 101, (v[n] = s(n - 1)));
    for(n=1, 101, (u[n] = p(n - 1)));
    w(i, j) = u[i] + v[j] + (i - 1) * (j - 1) - 1;
    tabl(nn) = {for(n=1, nn, for(k=1, n, print1(w(k, n - k + 1), ", "); ); print(); ); };
    tabl(10) \\ Indranil Ghosh, Mar 26 2017
    
  • Python
    # Produces the triangle when the array is read by antidiagonals
    import math
    from mpmath import *
    mp.dps = 100
    def s(n): return 1 if n<1 else s(n - 1) + 1 + int(math.floor(n*e))
    def p(n): return n + 1 + sum([int(math.floor((n - k)/e)) for k in range(0, n+1)])
    v=[s(n) for n in range(0, 101)]
    u=[p(n) for n in range(0, 101)]
    def w(i, j): return u[i - 1] + v[j - 1] + (i - 1) * (j - 1) - 1
    for n in range(1, 11):
        print([w(k, n - k + 1) for k in range(1, n + 1)]) # Indranil Ghosh, Mar 26 2017
Showing 1-3 of 3 results.