cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A343934 #26 May 07 2021 00:59:20
%S A343934 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,
%T A343934 14,12,8,16,17,16,18,16,19,18,16,20,16,21,20,16,22,20,16,23,22,20,16,
%U A343934 24,16,25,24,16,26,24,16,27,26,24,16,28,24,16
%N 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.
%C A343934 Row n starts with n, then the highest power of 2 dividing n is subtracted to produce the next entry in the row.
%C A343934 n first appears at position A000788(n)+1.
%H A343934 Peter Kagey, <a href="/A343934/b343934.txt">Rows n = 1..1023, flattened</a>
%e A343934 The triangle begins
%e A343934 1
%e A343934 2
%e A343934 3 2
%e A343934 4
%e A343934 5 4
%e A343934 6 4
%e A343934 7 6 4
%t A343934 Table[Most @ NestWhileList[# - 2^IntegerExponent[#, 2] &, n, # > 0 &], {n, 1, 30}] // Flatten (* _Amiram Eldar_, May 05 2021 *)
%o A343934 (Python)
%o A343934 def gen_a():
%o A343934     for n in range(1,100):
%o A343934         k = n
%o A343934         while k>0:
%o A343934             yield k
%o A343934             k = k & (k-1)
%o A343934 a = gen_a()
%Y A343934 Cf. A000120 (row widths), A000788, A006519, A129760, A298011 (row sums).
%K A343934 nonn,easy,tabf
%O A343934 1,2
%A A343934 _Christian Perfect_, May 04 2021