OFFSET
1,2
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.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
John Tyler Rascoe, Scatterplot of a(n) for n = 1...50000
EXAMPLE
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.
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
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
John Tyler Rascoe, Oct 29 2022
STATUS
approved