OFFSET
1,2
COMMENTS
A structure of rows is built up successively where each n blocks are added onto the preceding structure. The first row has an initial width of 3. After n = 1, n blocks are first added filling in the last row where n - 1 left off.
Once a row is filled a new row is started below it. After adding n blocks, if the final row reached is filled exactly, then the width of the next row is increased by one. Otherwise the width of the next row is the same as the previous.
Assuming the rows are built according to the given algorithm, a(n) is the number of blocks tagged 'n' in the last row that includes a block tagged 'n'." - Peter Luschny, Dec 20 2022
Will this sequence ever reach a point after which a(n) grows linearly? This is the case using an initial width of 2 instead of 3.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
EXAMPLE
After blocks 1 and 2, the initial row width 3 is exactly filled and hence the next row (of 3's and 4) is 1 longer.
|1|2|2| initial row
|3|3|3|4|
|4|4|4|5|
|5|5|5|5|
|6|6|6|6|6|
|6|_|_|_|_| last row after n=6
For n=6, the structure after blocks 1 through 6 have been added is as shown above and its final row has just one block (one 6) so that a(6) = 1.
MAPLE
A357261_list := proc(maxn) local A, g, c, n, r;
A := []; g := 3; c := 0;
for n from 1 to maxn do
r := irem(n + c, g);
c := r;
if r = 0 then
r := g; g := g + 1;
fi;
A := [op(A), r];
od; return A end:
A357261_list(77); # Peter Luschny, Dec 21 2022
PROG
(Python)
def A357261_list(maxn):
"""Returns a list of the first maxn terms"""
A = []
g = 3
c = 0
for n in range(1, maxn+1):
if (n + c)%g == 0:
A.append(g)
g += 1
c = 0
else:
A.append((n + c)%g)
c = A[-1]
return A
(PARI) lista(nn) = my(nbc=3, col=0, list=List()); for (n=1, nn, col = lift(Mod(col+n, nbc)); listput(list, if (col, col, nbc)); if (!col, nbc++); ); Vec(list); \\ Michel Marcus, Oct 17 2022
CROSSREFS
KEYWORD
AUTHOR
John Tyler Rascoe, Oct 08 2022
STATUS
approved