[go: up one dir, main page]

login
A356784
Inventory of positions as an irregular table; row 0 contains 0, subsequent rows contain the 0-based positions of 0's, followed by the position of 1's, of 2's, etc. in prior rows flattened.
12
0, 0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 4, 3, 5, 6, 7, 0, 1, 2, 4, 8, 3, 5, 9, 6, 10, 7, 12, 11, 13, 14, 15, 0, 1, 2, 4, 8, 16, 3, 5, 9, 17, 6, 10, 18, 7, 12, 21, 11, 19, 13, 22, 14, 24, 15, 26, 20, 23, 25, 28, 27, 29, 30, 31, 0, 1, 2, 4, 8, 16, 32, 3, 5, 9, 17, 33
OFFSET
0,7
COMMENTS
The n-th row contains A011782(n) terms, and is a permutation of 0..A011782(n)-1.
The leading term of each row is 0, and is followed by powers of 2, and then by positive nonpowers of 2.
LINKS
FORMULA
a(n) = 0 iff n belongs to A131577.
a(n) = 1 iff n belongs to A000051 \ {2}.
a(n) = 2 iff n belongs to A052548 \ {3, 4}.
a(n) = 3 iff n belongs to A005126 \ {2, 4}.
T(n, 0) = 0.
T(n, k) = 2^(k-1) for k = 1..n-1.
EXAMPLE
Table begins:
0,
0,
0, 1,
0, 1, 2, 3,
0, 1, 2, 4, 3, 5, 6, 7,
0, 1, 2, 4, 8, 3, 5, 9, 6, 10, 7, 12, 11, 13, 14, 15,
...
For n = 5:
- the terms in rows 0..4 are: 0, 0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 4, 3, 5, 6, 7,
- we have 0's at positions 0, 1, 2, 4, 8,
- we have 1's at positions 3, 5, 9,
- we have 2's at positions 6, 10,
- we have 3's at positions 7, 12,
- we have one 4 at position 11,
- we have one 5 at position 13,
- we have one 6 at position 14,
- we have one 7 at position 15,
- so row 5 is: 0, 1, 2, 4, 8, 3, 5, 9, 6, 10, 7, 12, 11, 13, 14, 15.
PROG
(C++) See Links section.
(Python)
terms = [0, ]
for i in range(1, 10):
new_terms = []
for j in range(max(terms)+1):
for k in range(len(terms)):
if terms[k] == j: new_terms.append(k)
terms.extend(new_terms)
print(terms) # Gleb Ivanov, Nov 01 2022
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Rémy Sigrist, Oct 01 2022
STATUS
approved