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.

A382255 Heinz number of the partition corresponding to run lengths in the bits of n.

This page as a plain text file.
%I A382255 #29 Aug 25 2025 22:32:45
%S A382255 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,
%T A382255 24,18,15,20,14,11,22,28,40,30,36,48,36,30,40,48,64,48,36,48,40,28,21,
%U A382255 30,36,27,36,48,36,30,25,30,40,30,21,28,22,13,26,44,56,42
%N A382255 Heinz number of the partition corresponding to run lengths in the bits of n.
%C A382255 The run lengths (number of consecutive bits that are equal) in the binary numbers in [2^(L-1), 2^L-1], i.e., of bit length L, yield all possible compositions of L, i.e., the partitions with any possible order of the parts.
%C A382255 Associated to any composition (p1, ..., pK) is their Heinz number prime(p1)*...*prime(pK) which depends only on the partition, i.e., not on the order of the parts.
%C A382255 The sequence can also be read as a table with row lengths 1, 1, 2, 4, 8, 16, 32, ... (= A011782), where row L = 0, 1, 2, 3, ... lists the 2^(L-1) compositions of L through their Heinz numbers (which will appear more than once if they contain at least two distinct parts).
%H A382255 Alois P. Heinz, <a href="/A382255/b382255.txt">Table of n, a(n) for n = 0..32768</a>
%F A382255 a(2^n) = A001747(n+1).
%F A382255 a(2^n-1) = A008578(n+1).
%F A382255 a(2^n+1) = A001749(n-1) for n>=2.
%e A382255    n | binary | partition | a(n) = Heinz number
%e A382255   ---+--------+-----------+--------------------
%e A382255    0 |   (0)  | empty sum | 1 = empty product
%e A382255    1 |     1  |     1     | 2 = prime(1)
%e A382255    2 |    10  |    1+1    | 4 = prime(1) * prime(1)
%e A382255    3 |    11  |     2     | 3 = prime(2)
%e A382255    4 |   100  |    1+2    | 6 = prime(1) * prime(2)
%e A382255    5 |   101  |   1+1+1   | 8 = 2^3 = prime(1) * prime(1) * prime(1)
%e A382255    6 |   110  |    2+1    | 6 = prime(2) * prime(1)
%e A382255    7 |   111  |     3     | 5 = prime(3)
%e A382255    8 |  1000  |    1+3    | 10 = 2*5 = prime(1) * prime(3)
%e A382255    9 |  1001  |   1+2+1   | 12 = 2^2*3 = prime(1) * prime(2) * prime(1)
%e A382255   ...|   ...  |    ...    | ...
%e A382255 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.
%e A382255 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.
%e A382255 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.
%e A382255 Then, n = 7 = 111[2] (in binary) has run lengths (3), namely: three bits 1. This gives a(5) = prime(3) = 5.
%e A382255 Sequence written as irregular triangle:
%e A382255    1;
%e A382255    2;
%e A382255    4,  3;
%e A382255    6,  8,  6,  5;
%e A382255   10, 12, 16, 12,  9, 12, 10,  7;
%e A382255   14, 20, 24, 18, 24, 32, 24, 20, 15, 18, 24, 18, 15, 20, 14, 11;
%e A382255   ...
%p A382255 a:= proc(n) option remember; `if`(n<2, 1+n, (p->
%p A382255       a(iquo(n, 2^p))*ithprime(p))(padic[ordp](n+(n mod 2), 2)))
%p A382255     end:
%p A382255 seq(a(n), n=0..100);  # _Alois P. Heinz_, Mar 20 2025
%o A382255 (PARI)
%o A382255 Heinz(p)=vecprod([ prime(k) | k <- p ])
%o A382255 RL(v) = if(#v, v=Vec(select(t->t,concat([1,v[^1]-v[^-1],1]),1)); v[^1]-v[^-1])
%o A382255 apply( {A382255(n) = Heinz(RL(binary(n)))}, [0..99] )
%Y A382255 Cf. A112798 and A296150 (partitions sorted by Heinz number).
%Y A382255 Cf. A185974, A334433, A334435, A334438, A334434, A129129, A334436 (partitions given as Heinz numbers, in Abramowitz-Stegun, Maple, Mathematica order).
%Y A382255 For "constructive" lists of partitions see A036036 (Abramowitz and Stegun order), A036036 (reversed), A080576 (Maple order), A080577 (Mathematica order).
%Y A382255 Row sums of triangle give A030017(n+1).
%Y A382255 Cf. A007088 (the binary numbers).
%Y A382255 Cf. A011782, A001747, A001749, A008578.
%Y A382255 Cf. A101211 (the run lengths as rows of a table).
%K A382255 nonn,look,base,changed
%O A382255 0,2
%A A382255 _M. F. Hasler_ and _Ali Sada_, Mar 19 2025