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

A358073 a(n) is the row position of the n-th number n after adding the number n, n times to the preceding triangle. A variant of A357261, see Comments and Examples for more details.

Original entry on oeis.org

1, 2, 3, 3, 4, 6, 4, 3, 3, 4, 6, 9, 13, 6, 21, 16, 33, 15, 34, 18, 3, 25, 12, 36, 25, 51, 18, 46, 15, 45, 16, 48, 21, 55, 30, 6, 43, 21, 60, 40, 81, 24, 67, 12, 57, 4, 51, 99, 49, 99, 3, 55, 108, 15, 70, 126, 36, 94, 6, 66, 127, 42, 105, 22, 87, 6, 73, 141, 63
Offset: 1

Views

Author

John Tyler Rascoe, Oct 29 2022

Keywords

Comments

A triangle is built up successively where n appears n times within the triangle. Each row has a set width before n is added, and the first row begins with a width of 1.
Numbers n are added to the first open position within the triangle or where the previous n left off so that no gaps are left in the rows of the triangle. If the row position of the n-th number n placed is the rightmost position within that row, then the width of the next row is increased by n. Otherwise, the width of the next row stays the same as the previous one.
The next row's width can only increase after a given n is added all n times. So when a row is filled after adding fewer than n n's, the next row, by definition, will have the same width.

Examples

			After 5 is added 5 times, the fifth 5 falls in the rightmost row position. So the width of the next row is increased by 5.
  |1|       initial row
  |2|2|
  |3|3|3|4|
  |4|4|4|5|
  |5|5|5|5|
  |6|6|6|6|6|6|7|7|7|
  |7|7|7|7|_|_|_|_|_|
a(7) = 4 because the row position of the seventh 7 added is 4.
		

Crossrefs

Programs

  • Maple
    A358073_list := proc(maxn)  local A, g, c, n, r;
    A := []; g := 1; c := 0;
    for n from 1 to maxn do
        r := irem(n + c, g);
        c := r;
        if r = 0 then
            r := g;
            g := g + n;
        fi;
        A := [op(A), r];
    od; return A end:
    A358073_list(69); # Peter Luschny, Dec 21 2022
  • Python
    def A358073_list(maxn):
        """Returns a list of the first maxn terms"""
        A = []
        g = 1
        c = 0
        for n in range(1,maxn+1):
            if (n + c)%g ==0:
                A.append(g)
                g += n
                c = 0
            else:
                A.append((n + c)%g)
                c = A[-1]
        return A
Showing 1-1 of 1 results.