A382255 Heinz number of the partition corresponding to run lengths in the bits of n.
1, 2, 4, 3, 6, 8, 6, 5, 10, 12, 16, 12, 9, 12, 10, 7, 14, 20, 24, 18, 24, 32, 24, 20, 15, 18, 24, 18, 15, 20, 14, 11, 22, 28, 40, 30, 36, 48, 36, 30, 40, 48, 64, 48, 36, 48, 40, 28, 21, 30, 36, 27, 36, 48, 36, 30, 25, 30, 40, 30, 21, 28, 22, 13, 26, 44, 56, 42
Offset: 0
Examples
n | binary | partition | a(n) = Heinz number ---+--------+-----------+-------------------- 0 | (0) | empty sum | 1 = empty product 1 | 1 | 1 | 2 = prime(1) 2 | 10 | 1+1 | 4 = prime(1) * prime(1) 3 | 11 | 2 | 3 = prime(2) 4 | 100 | 1+2 | 6 = prime(1) * prime(2) 5 | 101 | 1+1+1 | 8 = 2^3 = prime(1) * prime(1) * prime(1) 6 | 110 | 2+1 | 6 = prime(2) * prime(1) 7 | 111 | 3 | 5 = prime(3) 8 | 1000 | 1+3 | 10 = 2*5 = prime(1) * prime(3) 9 | 1001 | 1+2+1 | 12 = 2^2*3 = prime(1) * prime(2) * prime(1) ...| ... | ... | ... For example, n = 4 = 100[2] (in binary) has run lengths (1, 2), namely: one bit 1 followed by two bits 0. This gives a(4) = prime(1)*prime(2) = 6. Next, n = 5 = 101[2] (in binary) has run lengths (1, 1, 1): one bit 1, followed by one bit 0, followed by one bit 1. This gives a(4) = prime(1)^3 = 8. Then, n = 6 = 110[2] (in binary) has run lengths (2, 1): first two bits 1, then one bit 0. This is the same as for 4, just in reverse order, so it yields the same Heinz number a(6) = prime(2)*prime(1) = 6. Then, n = 7 = 111[2] (in binary) has run lengths (3), namely: three bits 1. This gives a(5) = prime(3) = 5. Sequence written as irregular triangle: 1; 2; 4, 3; 6, 8, 6, 5; 10, 12, 16, 12, 9, 12, 10, 7; 14, 20, 24, 18, 24, 32, 24, 20, 15, 18, 24, 18, 15, 20, 14, 11; ...
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..32768
Crossrefs
Cf. A185974, A334433, A334435, A334438, A334434, A129129, A334436 (partitions given as Heinz numbers, in Abramowitz-Stegun, Maple, Mathematica order).
For "constructive" lists of partitions see A036036 (Abramowitz and Stegun order), A036036 (reversed), A080576 (Maple order), A080577 (Mathematica order).
Row sums of triangle give A030017(n+1).
Cf. A007088 (the binary numbers).
Cf. A101211 (the run lengths as rows of a table).
Programs
-
Maple
a:= proc(n) option remember; `if`(n<2, 1+n, (p-> a(iquo(n, 2^p))*ithprime(p))(padic[ordp](n+(n mod 2), 2))) end: seq(a(n), n=0..100); # Alois P. Heinz, Mar 20 2025
-
PARI
Heinz(p)=vecprod([ prime(k) | k <- p ]) RL(v) = if(#v, v=Vec(select(t->t,concat([1,v[^1]-v[^-1],1]),1)); v[^1]-v[^-1]) apply( {A382255(n) = Heinz(RL(binary(n)))}, [0..99] )
Comments