A348296 Irregular table T(n, k), n > 0, k = 1..A000120(n), read by rows; the n-th contains, in ascending order, the distinct powers of 2 summing to n.
1, 2, 1, 2, 4, 1, 4, 2, 4, 1, 2, 4, 8, 1, 8, 2, 8, 1, 2, 8, 4, 8, 1, 4, 8, 2, 4, 8, 1, 2, 4, 8, 16, 1, 16, 2, 16, 1, 2, 16, 4, 16, 1, 4, 16, 2, 4, 16, 1, 2, 4, 16, 8, 16, 1, 8, 16, 2, 8, 16, 1, 2, 8, 16, 4, 8, 16, 1, 4, 8, 16, 2, 4, 8, 16, 1, 2, 4, 8, 16, 32
Offset: 1
Examples
Triangle T(n, k) begins: n n-th row -- ------------ 1 [1] 2 [2] 3 [1, 2] 4 [4] 5 [1, 4] 6 [2, 4] 7 [1, 2, 4] 8 [8] 9 [1, 8] 10 [2, 8] 11 [1, 2, 8] 12 [4, 8] 13 [1, 4, 8] 14 [2, 4, 8] 15 [1, 2, 4, 8]
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10870 (rows n = 1..2000, flattened)
- Index entries for sequences related to binary expansion of n
Programs
-
Mathematica
Array[DeleteCases[Union@ NumberExpand[#, 2], 0] &, 32] // Flatten (* Michael De Vlieger, Jul 19 2022 *)
-
PARI
row(n) = { my (r=vector(hammingweight(n))); for (k=1, #r, n -= r[k] = 2^valuation(n, 2)); return (r) }