OFFSET
1,2
COMMENTS
Row n starts with n, then the highest power of 2 dividing n is subtracted to produce the next entry in the row.
n first appears at position A000788(n)+1.
LINKS
Peter Kagey, Rows n = 1..1023, flattened
EXAMPLE
The triangle begins
1
2
3 2
4
5 4
6 4
7 6 4
MATHEMATICA
Table[Most @ NestWhileList[# - 2^IntegerExponent[#, 2] &, n, # > 0 &], {n, 1, 30}] // Flatten (* Amiram Eldar, May 05 2021 *)
PROG
(Python)
def gen_a():
for n in range(1, 100):
k = n
while k>0:
yield k
k = k & (k-1)
a = gen_a()
CROSSREFS
KEYWORD
nonn,easy,tabf
AUTHOR
Christian Perfect, May 04 2021
STATUS
approved