login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A343934 Irregular triangle read by rows: row n gives the sequence of iterations of k - A006519(k), starting with k=n, until 0 is reached. 1
1, 2, 3, 2, 4, 5, 4, 6, 4, 7, 6, 4, 8, 9, 8, 10, 8, 11, 10, 8, 12, 8, 13, 12, 8, 14, 12, 8, 15, 14, 12, 8, 16, 17, 16, 18, 16, 19, 18, 16, 20, 16, 21, 20, 16, 22, 20, 16, 23, 22, 20, 16, 24, 16, 25, 24, 16, 26, 24, 16, 27, 26, 24, 16, 28, 24, 16 (list; graph; refs; listen; history; text; internal format)
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

Cf. A000120 (row widths), A000788, A006519, A129760, A298011 (row sums).

Sequence in context: A304098 A239690 A208460 * A119465 A090321 A241255

Adjacent sequences:  A343931 A343932 A343933 * A343935 A343936 A343937

KEYWORD

nonn,easy,tabf

AUTHOR

Christian Perfect, May 04 2021

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 7 09:15 EST 2021. Contains 349574 sequences. (Running on oeis4.)