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.

Original entry on oeis.org

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

Views

Author

M. F. Hasler and Ali Sada, Mar 19 2025

Keywords

Comments

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.
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.
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).

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;
  ...
		

Crossrefs

Cf. A112798 and A296150 (partitions sorted by Heinz number).
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] )

Formula

a(2^n) = A001747(n+1).
a(2^n-1) = A008578(n+1).
a(2^n+1) = A001749(n-1) for n>=2.