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.

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.

This page as a plain text file.
%I A358073 #31 Jan 13 2023 18:59:09
%S A358073 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,
%T A358073 46,15,45,16,48,21,55,30,6,43,21,60,40,81,24,67,12,57,4,51,99,49,99,3,
%U A358073 55,108,15,70,126,36,94,6,66,127,42,105,22,87,6,73,141,63
%N 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.
%C A358073 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.
%C A358073 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.
%C A358073 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.
%H A358073 John Tyler Rascoe, <a href="/A358073/b358073.txt">Table of n, a(n) for n = 1..10000</a>
%H A358073 John Tyler Rascoe, <a href="/A358073/a358073.png">Scatterplot of a(n) for n = 1...50000</a>
%e A358073 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.
%e A358073   |1|       initial row
%e A358073   |2|2|
%e A358073   |3|3|3|4|
%e A358073   |4|4|4|5|
%e A358073   |5|5|5|5|
%e A358073   |6|6|6|6|6|6|7|7|7|
%e A358073   |7|7|7|7|_|_|_|_|_|
%e A358073 a(7) = 4 because the row position of the seventh 7 added is 4.
%p A358073 A358073_list := proc(maxn)  local A, g, c, n, r;
%p A358073 A := []; g := 1; c := 0;
%p A358073 for n from 1 to maxn do
%p A358073     r := irem(n + c, g);
%p A358073     c := r;
%p A358073     if r = 0 then
%p A358073         r := g;
%p A358073         g := g + n;
%p A358073     fi;
%p A358073     A := [op(A), r];
%p A358073 od; return A end:
%p A358073 A358073_list(69); # _Peter Luschny_, Dec 21 2022
%o A358073 (Python)
%o A358073 def A358073_list(maxn):
%o A358073     """Returns a list of the first maxn terms"""
%o A358073     A = []
%o A358073     g = 1
%o A358073     c = 0
%o A358073     for n in range(1,maxn+1):
%o A358073         if (n + c)%g ==0:
%o A358073             A.append(g)
%o A358073             g += n
%o A358073             c = 0
%o A358073         else:
%o A358073             A.append((n + c)%g)
%o A358073             c = A[-1]
%o A358073     return A
%Y A358073 Cf. A002024, A057176, A064434, A096535, A104647, A275204, A357261.
%K A358073 nonn,easy,look
%O A358073 1,2
%A A358073 _John Tyler Rascoe_, Oct 29 2022