|
|
A032531
|
|
An inventory sequence: triangle read by rows, where T(n, k), 0 <= k <= n, records the number of k's thus far in the flattened sequence.
|
|
8
|
|
|
0, 1, 1, 1, 3, 0, 2, 3, 1, 2, 2, 4, 3, 3, 1, 2, 5, 4, 4, 3, 1, 2, 6, 5, 5, 3, 3, 1, 2, 7, 6, 7, 3, 3, 2, 2, 2, 7, 9, 9, 3, 3, 2, 3, 0, 3, 7, 10, 13, 3, 3, 2, 4, 0, 2, 4, 7, 12, 15, 5, 4, 2, 5, 0, 2, 1, 5, 8, 14, 15, 6, 6, 4, 5, 1, 2, 1, 0, 6, 10, 15, 15, 7, 7, 5, 7, 1, 2, 2, 0, 1, 7, 12, 17
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
Old name: a(n) = number of a(i) for 0<=i<n that are equal to A002262(n).
This sequence is a variation of the Inventory sequence A342585. The same rules apply except that in this variation each row ends after k terms, where k is the current row count which starts at 1. The behavior up to the first 1 million terms is similar to A342585 but beyond that the most common terms do not increase, likely due to the rows being cut off after k terms thus numbers such as 1 and 2 no longer make regular appearances. Larger number terms do increase and overtake the leading early terms, and it appears this pattern repeats as n increases. See the linked images. - Scott R. Shannon, Sep 13 2021
The complexity of this sequence derives from the totals being updated during the calculation of each row. If each row recorded an inventory of only the earlier rows, we would get the much simpler A025581. - Peter Munn, May 06 2023
|
|
LINKS
|
|
|
MAPLE
|
n - binomial(floor(1/2+sqrt(2*(1+n))), 2);
end proc:
option remember;
local a, piv, i ;
a := 0 ;
for i from 0 to n-1 do
if procname(i) = piv then
a := a+1 ;
end if;
end do:
a ;
end proc:
|
|
PROG
|
(Python)
from math import comb, isqrt
from collections import Counter
def idx(n): return n - comb((1+isqrt(8+8*n))//2, 2)
def aupton(nn):
num, alst, inventory = 0, [0], Counter([0])
for n in range(1, nn+1):
c = inventory[idx(n)]
alst.append(c)
inventory[c] += 1
return alst
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
Dmitri Papichev (Dmitri.Papichev(AT)iname.com)
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|