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.

Showing 1-10 of 14 results. Next

A227183 a(n) is the sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n; row sums of A227739 for n >= 1.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 3, 3, 6, 5, 4, 6, 5, 4, 4, 4, 8, 7, 6, 8, 8, 5, 7, 9, 7, 6, 5, 7, 6, 5, 5, 5, 10, 9, 8, 10, 10, 7, 9, 11, 12, 9, 6, 10, 11, 8, 10, 12, 9, 8, 7, 9, 9, 6, 8, 10, 8, 7, 6, 8, 7, 6, 6, 6, 12, 11, 10, 12, 12, 9, 11, 13, 14, 11, 8, 12, 13, 10, 12, 14
Offset: 0

Views

Author

Antti Karttunen, Jul 05 2013

Keywords

Comments

Like A129594 this sequence utilizes the fact that compositions (i.e., ordered partitions) can be bijectively mapped to (unordered) partitions by taking the partial sums of the list of composants after one has been subtracted from each except the first one. Compositions in turn are mapped to nonnegative integers via the runlength encoding, where the lengths of maximum runs of 0's or 1's in binary representation of n give the composants. See the OEIS Wiki page and the example below.
Each n occurs A000041(n) times in total and occurs for the first time at A227368(n) and for the last time at position A000225(n). See further comments and conjectures at A227368 and A227370.

Examples

			19 has binary expansion "10011", thus the maximal runs of identical bits (scanned from right to left) are [2,2,1]. We subtract one from each after the first one, to get [2,1,0] and then form their partial sums as [2,2+1,2+1+0], which thus maps to unordered partition {2+3+3} which adds to 8. Thus a(19)=8.
		

Crossrefs

Row sums of A227189 and A227739. Cf. A227184 (corresponding products), A227185, A227189, A227192, A129594, A226062, A227368.
Analogous sum sequences computed for other encoding schemes of unordered partitions: A036042, A056239, A161511, A243503. Cf. also A229119, A003188, A075157, A243353 (associated permutations mapping between these schemes).

Programs

  • Mathematica
    Table[Function[b, Total@ Accumulate@ Prepend[If[Length@ b > 1, Rest[b] - 1, {}], First@ b] - Boole[n == 0]]@ Map[Length, Split@ Reverse@ IntegerDigits[n, 2]], {n, 0, 79}] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • Python
    def A227183(n):
      '''Sum of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n.'''
      s = 0
      b = n%2
      i = 1
      while (n != 0):
        n >>= 1
        if ((n%2) == b): # Staying in the same run of bits?
          i += 1
        else: # The run changes.
          b = n%2
          s += i
      return(s)

Formula

a(n) = Sum_{i=0..A005811(n)-1} A227189(n,i). [The defining formula]
Equivalently, for n>=1, a(n) = Sum_{i=(A173318(n-1)+1)..A173318(n)} A227739(i).
a(n) = A227192(n) - A000217(A005811(n)-1).
Other identities:
a(A129594(n)) = a(n). [This follows from the fact that conjugating a partition doesn't change its total sum]
a(A226062(n)) = a(n). [Which is also true for the "Bulgarian operation"]
From Antti Karttunen, Mar 08 2015: (Start)
Can be also obtained by mapping with an appropriate permutation from the sequences giving sizes of each partition (i.e., sum of their parts) computed for other enumerations similar to A227739:
a(n) = A036042(A229119(n)).
a(n) = A161511(A003188(n)).
a(n) = A056239(A243353(n)).
a(n) = A243503(1+A075157(n)).
(End)

A243353 Permutation of natural numbers which maps between the partitions as encoded in A227739 (binary based system, zero-based) to A112798 (prime-index based system, one-based).

Original entry on oeis.org

1, 2, 4, 3, 9, 8, 6, 5, 25, 18, 16, 27, 15, 12, 10, 7, 49, 50, 36, 75, 81, 32, 54, 125, 35, 30, 24, 45, 21, 20, 14, 11, 121, 98, 100, 147, 225, 72, 150, 245, 625, 162, 64, 243, 375, 108, 250, 343, 77, 70, 60, 105, 135, 48, 90, 175, 55, 42, 40, 63, 33, 28, 22, 13, 169, 242, 196, 363, 441, 200, 294, 605, 1225, 450, 144
Offset: 0

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Comments

Note the indexing: the domain includes zero, but the range starts from one.

Crossrefs

A243354 gives the inverse mapping.

Programs

  • Mathematica
    f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; Table[f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, 74}] (* Michael De Vlieger, May 09 2017 *)
  • Python
    from sympy import prime
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def a003188(n): return n^int(n/2)
    def a243353(n): return a005940(1 + a003188(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A243353 n) (A005940 (+ 1 (A003188 n))))
    

Formula

a(n) = A005940(1+A003188(n)).
a(n) = A241909(1+A075157(n)). [With A075157's original starting offset]
For all n >= 0, A243354(a(n)) = n.
A227183(n) = A056239(a(n)). [Maps between the corresponding sums ...]
A227184(n) = A003963(a(n)). [... and products of parts of each partition].
For n >= 0, a(A037481(n)) = A002110(n). [Also "triangular partitions", the fixed points of Bulgarian solitaire, A226062 & A242424].
For n >= 1, a(A227451(n+1)) = 4*A243054(n).

A243354 Permutation of natural numbers which maps between the partitions as encoded in A112798 (prime-index based system, one-based) to A227739 (binary based system, zero-based).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 5, 4, 14, 31, 13, 63, 30, 12, 10, 127, 9, 255, 29, 28, 62, 511, 26, 8, 126, 11, 61, 1023, 25, 2047, 21, 60, 254, 24, 18, 4095, 510, 124, 58, 8191, 57, 16383, 125, 27, 1022, 32767, 53, 16, 17, 252, 253, 65535, 22, 56, 122, 508, 2046, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 05 2014

Keywords

Comments

Note the indexing: the domain starts from one, but the range also includes zero.

Crossrefs

Programs

Formula

a(n) = A006068(A156552(n)).
a(n) = A075158(A241909(n)-1). [With A075158's original starting offset].
For all n >= 1, A243353(a(n)) = n.
A056239(n) = A227183(a(n)).
A003963(n) = A227184(a(n)).
A037481(n) = a(A002110(n)).

A114994 Numbers whose binary representation has monotonically decreasing sizes of groups of zeros (including zero-length groups between adjacent ones).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 21, 23, 31, 32, 33, 34, 35, 36, 37, 39, 42, 43, 47, 63, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 79, 85, 87, 95, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 143, 146, 147, 149, 151, 159, 170, 171, 175
Offset: 0

Views

Author

Keywords

Comments

Numbers whose binary representation avoids the sequences 110, 10100, 1001000, etc. Represents partitions. Start with empty partition and process each bit from left to right: if a zero, increase the size of the smallest part; if one, add a new size 1 part. This generates the partitions in Mathematica order. Can be regarded as a table with row lengths A000041(n); values 2^n <= a(m) < 2^(n+1) are in row n, representing the partitions of n. (Interpreting arbitrary binary numbers in this way generates compositions [also known as ordered partitions]; these are the compositions where the part sizes are in decreasing order of size.)
From Vladimir Shevelev, Dec 09 2013: (Start)
Every number in binary is a concatenation of parts of the form 10...0 with k>=0 zeros. For example, 5=(10)(1), 11=(10)(1)(1), 7=(1)(1)(1). Define c-multiplication [*] by adding multiplicities of parts (ordering by nonincreasing numbers of 0's). For example, 5[*]3=(10)(1)(1)(1)=23. Two numbers we call equivalent if they have the same parts with the same multiplicities. So 6~5, 12~9, 14~13~11.
The sequence lists equivalence classes of integers, choosing the minimal representative in each.
Note that, for two terms x,y we have x[*]y=y[*]x (commutativity), and for three terms x,y,z we have x[*](y[*]z)= (x[*]y)[*]z (associativity). 0 is the unit, i.e., 0[*]x=x. Moreover, one can consider different parts, i.e., {2^n} as "c-primes". Then every term is a unique "c-product" of "c-powers" of c-primes. For example, 7=(1)^3, 10=(10)^2, etc.
Further, one can naturally introduce "c-notions": c-divisor, c-divisibility, greatest common c-divisor of several numbers and least common c-multiple, Euler c-totient function (with notion of "r is c-prime to m"), etc.
Let x[+]y denote usual sum x+y in which we order parts over nonincreasing number of zeros. Then, of course, A114994 is closed over such operation. Then a(n+1) = a(n)[+]k, where k is the least number such that a(n)[+]k > a(n). For example, since a(10)=11, we have 11[+]1=9, 11[+]2=11, 11[+]3=11, 11[+]4=15>11. So, a(11)=15.
(End)

Examples

			21 is included, binary 10101 has group sizes 1,1,0; 22 is not, binary 10110 has group sizes 1,0,1, which includes an increase.
Applying bits of 21 in order gives sequence of partitions: [], [1], [2], [2,1], [2^2], [2^2,1], so 21 represents the partition [2^2,1].
From _Omar E. Pol_, Aug 04 2013: (Start)
The positive terms written as an irregular triangle begins:
   1;
   2,  3;
   4,  5,  7;
   8,  9, 10, 11, 15;
  16, 17, 18, 19, 21, 23, 31;
  32, 33, 34, 35, 36, 37, 39, 42, 43, 47, 63;
  64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 79, 85, 87, 95, 127;
  ...
Column 1 is A000079. Right border gives A000225, n >= 1.
T(n,k) represents the k-th partition of n. Example: for n = 5 the seven partitions of 5 (in Mathematica order) are represented in three ways as shown below. The last column (16, 17, 18, 19, 21, 23, 31) is also the 5th row of triangle.
-----------------------------------
Partitions      Binary     Decimal
of 5            number      value
-----------------------------------
5               10000        16
4+1             10001        17
3+2             10010        18
3+1+1           10011        19
2+2+1           10101        21
2+1+1+1         10111        23
1+1+1+1+1       11111        31
(End)
From _Peter J. C. Moses_, Dec 09 2013: (Start)
Let us illustrate an algorithm of calculation of all terms in interval of the form [2^k,2^(k+1)). Let k=5. Consider all integer partitions of 5+1=6 ordered over decreasing of maximal parts (see algorithm IntegerPartitions). We have: {{6},{5,1},{4,2},{4,1,1},{3,3},{3,2,1},{3,1,1,1},{2,2,2},{2,2,1,1},{2,1,1,1,1},{1,1,1,1,1,1}}.
Now for every number, i, replace it with 1 followed by (i-1) 0's. So that becomes: {{1,0,0,0,0,0},{1,0,0,0,0,1},{1,0,0,0,1,0},{1,0,0,0,1,1},{1,0,0,1,0,0},{1,0,0,1,0,1},{1,0,0,1,1,1},{1,0,1,0,1,0},{1,0,1,0,1,1},{1,0,1,1,1,1},{1,1,1,1,1,1}}.
Finally, reading these as binary numbers with transformation of them into decimal, we obtain all terms in interval [32,64): {32,33,34,35,36,37,39,42,43,47,63}.
(End)
		

Crossrefs

Cf. also A227739, A227183 and permutation pair A229119/A229120 for another system of encoding unordered partitions in the binary representation of n.

Programs

  • Mathematica
    Select[Range[0, 200], FromDigits[Flatten[Sort[Split[IntegerDigits[#, 2], #1>#2||#2==0&], Length[#1]>Length[#2]&]], 2]==#&] (* Peter J. C. Moses, Dec 04 2013 *)
    f:=Map[IntegerDigits[2^(#-1), 2]&, #]&; Flatten[Map[Map[FromDigits[#, 2]&, Map[Flatten, f[IntegerPartitions[#]]]]&, Range[0, 10]]] (* Peter J. C. Moses, Dec 05 2013 *)
  • PARI
    is(n, k=0)=if(n==0, return(1)); my(e=valuation(n, 2)); if(e>(e+1), e)) \\ Charles R Greathouse IV, Dec 05 2013

Formula

For n>=0, 2n+1 is in the sequence iff n is in the sequence. For n>0, 2n is in the sequence iff both n is the sequence and, for some k>=0, n is congruent to 2^k mod 4^(k+1).
Number terms in interval [2^(n-1), 2^n) is A000041(n); number terms <2^n is A000070(n). - Vladimir Shevelev, Dec 06 2013

A227736 Irregular table read by rows: the first entry of n-th row is length of run of rightmost identical bits (either 0 or 1, equal to n mod 2), followed by length of the next run of bits, etc., in the binary representation of n, when scanned from the least significant to the most significant end.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 3, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 3, 4, 4, 1, 1, 3, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 3, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 2, 3, 1, 1, 3, 1, 4, 5, 5, 1, 1, 4, 1, 1, 1, 3, 1
Offset: 1

Views

Author

Antti Karttunen, Jul 25 2013

Keywords

Comments

Row n has A005811(n) terms. In rows 2^(k-1)..2^k-1 we have all the compositions (ordered partitions) of k. Other orderings of compositions: A101211 (same with rows reversed), A066099, A108244 and A124734.
Each row n >= 1 contains the initial A005811(n) nonzero terms from the beginning of row n of A227186. A070939(n) gives the sum of terms on row n, while A167489(n) gives the product of its terms. A136480 gives the first column. A101211 lists the terms of each row in reverse order.

Examples

			Table begins as:
  Row  n in    Terms on
   n   binary  that row
   1      1    1;
   2     10    1,1;
   3     11    2;
   4    100    2,1;
   5    101    1,1,1;
   6    110    1,2;
   7    111    3;
   8   1000    3,1;
   9   1001    1,2,1;
  10   1010    1,1,1,1;
  11   1011    2,1,1;
  12   1100    2,2;
  13   1101    1,1,2;
  14   1110    1,3;
  15   1111    4;
  16  10000    4,1;
etc. with the terms of row n appearing in reverse order compared how the runs of the same length appear in the binary expansion of n (Cf. A101211).
From _Omar E. Pol_, Sep 08 2013: (Start)
Illustration of initial terms:
  ---------------------------------------
  k   m     Diagram        Composition
  ---------------------------------------
  .          _
  1   1     |_|_           1;
  2   1     |_| |          1, 1,
  2   2     |_ _|_         2;
  3   1     |_  | |        2, 1,
  3   2     |_|_| |        1, 1, 1,
  3   3     |_|   |        1, 2,
  3   4     |_ _ _|_       3;
  4   1     |_    | |      3, 1,
  4   2     |_|_  | |      1, 2, 1,
  4   3     |_| | | |      1, 1, 1, 1,
  4   4     |_ _|_| |      2, 1, 1,
  4   5     |_  |   |      2, 2,
  4   6     |_|_|   |      1, 1, 2,
  4   7     |_|     |      1, 3,
  4   8     |_ _ _ _|_     4;
  5   1     |_      | |    4, 1,
  5   2     |_|_    | |    1, 3, 1,
  5   3     |_| |   | |    1, 1, 2, 1,
  5   4     |_ _|_  | |    2, 2, 1,
  5   5     |_  | | | |    2, 1, 1, 1,
  5   6     |_|_| | | |    1, 1, 1, 1, 1,
  5   7     |_|   | | |    1, 2, 1, 1,
  5   8     |_ _ _|_| |    3, 1, 1,
  5   9     |_    |   |    3, 2,
  5  10     |_|_  |   |    1, 2, 2,
  5  11     |_| | |   |    1, 1, 1, 2,
  5  12     |_ _|_|   |    2, 1, 2,
  5  13     |_  |     |    2, 3,
  5  14     |_|_|     |    1, 1, 3,
  5  15     |_|       |    1, 4,
  5  16     |_ _ _ _ _|    5;
.
Also irregular triangle read by rows in which row k lists the compositions of k, k >= 1.
Triangle begins:
 [1];
 [1,1], [2];
 [2,1], [1,1,1], [1,2],[3];
 [3,1], [1,2,1], [1,1,1,1], [2,1,1], [2,2], [1,1,2], [1,3], [4];
 [4,1], [1,3,1], [1,1,2,1], [2,2,1], [2,1,1,1], [1,1,1,1,1], [1,2,1,1], [3,1,1], [3,2], [1,2,2], [1,1,1,2], [2,1,2], [2,3], [1,1,3], [1,4], [5];
Row k has length A001792(k-1).
Row sums give A001787(k), k >= 1.
(End)
		

Crossrefs

Cf. A227738 and also A227739 for similar table for unordered partitions.
Cf. A101211 (rows in reversed order).

Programs

  • Haskell
    import Data.List (group)
    a227736 n k = a227736_tabf !! (n-1) !! (k-1)
    a227736_row n = a227736_tabf !! (n-1)
    a227736_tabf = map (map length . group) $ tail a030308_tabf
    -- Reinhard Zumkeller, Aug 11 2014
    
  • Mathematica
    Array[Length /@ Reverse@ Split@ IntegerDigits[#, 2] &, 34] // Flatten (* Michael De Vlieger, Dec 11 2020 *)
  • PARI
    apply( {A227736_row(n, r=[1], b=n%2)=while(n\=2, n%2==b && r[#r]++ || [b=1-b, r=concat(r,1)]); r}, [1..22]) \\ M. F. Hasler, Mar 11 2025
    
  • Python
    def A227736_row(n): return[len(list(g))for _,g in groupby(bin(n)[:1:-1])]
    from itertools import groupby # M. F. Hasler, Mar 11 2025
  • Scheme
    (define (A227736 n) (A227186bi (A227737 n) (A227740 n))) ;; The Scheme-function for A227186bi has been given in A227186.
    

Formula

a(n) = A227186(A227737(n), A227740(n)).
a(n) = A101211(A227741(n)).

A242628 Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 1, 1, 4, 3, 3, 3, 2, 2, 2, 2, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 5, 4, 4, 4, 3, 3, 3, 3, 4, 2, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2, 4, 1, 3, 3, 1, 3, 2, 1, 2, 2, 2, 1, 3, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 5, 5, 4, 4, 4, 4, 5, 3, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 5, 2
Offset: 1

Views

Author

Keywords

Comments

This can be calculated using the binary expansion of n; see the PARI program.
The n-th row consists of all partitions with hook size (maximum + number of parts - 1) equal to n.
The partitions in row n of this sequence are the conjugates of the partitions in row n of A125106 taken in reverse order.
Row n is also the reversed partial sums plus one of the n-th composition in standard order (A066099) minus one. - Gus Wiseman, Nov 07 2022

Examples

			The table starts:
  1;
  2; 1,1;
  3; 2,2; 2,1; 1,1,1;
  4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
  ...
		

Crossrefs

Cf. A241596 (another version of this list of partitions), A125106, A240837, A112531, A241597 (compositions).
For other schemes to list integer partitions, please see for example A227739, A112798, A241918, A114994.
First element in each row is A008687.
Last element in each row is A065120.
Heinz numbers of rows are A253565.
Another version is A358134.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> x[], b(n))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    T[1] = {{1}};
    T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
    Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
  • PARI
    apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.

A241918 Table of partitions where the ordering is based on the modified partial sums of the exponents of primes in the prime factorization of n.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5
Offset: 1

Views

Author

Antti Karttunen, May 03 2014, based on Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

a(1) = 0 by convention (stands for an empty partition).
For n >= 2, A203623(n-1)+2 gives the index to the beginning of row n and for n>=1, A203623(n)+1 is the index to the end of row n.

Examples

			Table begins:
Row     Partition
[ 1]    0;         (stands for empty partition)
[ 2]    1;         (as 2 = 2^1)
[ 3]    1,1;       (as 3 = 2^0 * 3^1)
[ 4]    2;         (as 4 = 2^2)
[ 5]    1,1,1;     (as 5 = 2^0 * 3^0 * 5^1)
[ 6]    2,2;       (as 6 = 2^1 * 3^1)
[ 7]    1,1,1,1;   (as 7 = 2^0 * 3^0 * 5^0 * 7^1)
[ 8]    3;         (as 8 = 2^3)
[ 9]    1,2;       (as 9 = 2^0 * 3^2)
[10]    2,2,2;     (as 10 = 2^1 * 3^0 * 5^1)
[11]    1,1,1,1,1;
[12]    3,3;
[13]    1,1,1,1,1,1;
[14]    2,2,2,2;
[15]    1,2,2;     (as 15 = 2^0 * 3^1 * 5^1)
[16]    4;
[17]    1,1,1,1,1,1,1;
[18]    2,3;       (as 18 = 2^1 * 3^2)
etc.
If n is 2^k (k>=1), then the partition is a singleton {k}, otherwise, add one to the exponent of 2 (= A007814(n)), and subtract one from the exponent of the greatest prime dividing n (= A071178(n)), leaving the intermediate exponents as they are, and then take partial sums of all, thus resulting for e.g. 15 = 2^0 * 3^1 * 5^1 the modified sequence of exponents {0+1, 1, 1-1} -> {1,1,0}, whose partial sums {1,1+1,1+1+0} -> {1,2,2} give the corresponding partition at row 15.
		

Crossrefs

For n>=2, the length of row n is given by A061395(n).
Cf. also A067255, A203623, A241914.
Other tables of partitions: A112798 (also based on prime factorization), A227739, A242628 (encoded in the binary representation of n), and A036036-A036037, A080576-A080577, A193073 for various lexicographical orderings.
Permutation A241909 maps between order of partitions employed here, and the order employed in A112798.
Permutation A122111 is induced when partitions in this list are conjugated.
A241912 gives the row numbers for which the corresponding rows in A112798 and here are the conjugate partitions of each other.

Programs

  • Mathematica
    Table[If[n == 1, {0}, Function[s, Function[t, Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, s]]]]@ ConstantArray[0, Transpose[s][[1, -1]]]][FactorInteger[n] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]], {n, 31}] // Flatten (* Michael De Vlieger, May 12 2017 *)

Formula

If A241914(n)=0 and A241914(n+1)=0, a(n) = A067255(n); otherwise, if A241914(n)=0 and A241914(n+1)>0, a(n) = A067255(n)+1; otherwise, if A241914(n)>0 and A241914(n+1)=0, a(n) = a(n-1) + A067255(n) - 1, otherwise, when A241914(n)>0 and A241914(n+1)>0, a(n) = a(n-1) + A067255(n).

A227184 a(n) = product of parts of the unordered partition encoded with the runlengths of binary expansion of n.

Original entry on oeis.org

1, 1, 1, 2, 4, 1, 2, 3, 9, 4, 1, 8, 6, 2, 3, 4, 16, 9, 4, 18, 16, 1, 8, 27, 12, 6, 2, 12, 8, 3, 4, 5, 25, 16, 9, 32, 36, 4, 18, 48, 81, 16, 1, 32, 54, 8, 27, 64, 20, 12, 6, 24, 24, 2, 12, 36, 15, 8, 3, 16, 10, 4, 5, 6, 36, 25, 16, 50, 64, 9, 32, 75, 144, 36, 4, 72
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Comments

a(0) = 1, as 0 is here considered to encode an empty partition {}, and the empty product is one.
Like A129594, this sequence is based on the fact that compositions (i.e., ordered partitions) can be mapped 1-to-1 to partitions by taking the partial sums of the list where one is subtracted from each composant except the first (originally explained by Marc LeBrun in his Jan 11 2006 post on SeqFan mailing list, with an additional twist involving factorization and prime exponents, cf. A129595). The example below show how this works.
Compare the scatterplot of this sequence to those of A002487, A243353, A243499 and A253552.

Examples

			8 has binary expansion "1000", whose runs have lengths [3,1] when arranged from the least significant to the most significant end. Taking partial sums of 3 and 0, we get 3 and 3, whose product is 9, thus a(8) = 9.
For 44, in binary "101100", the run lengths are [2,2,1,1] (from the least significant end), and subtracting one from all terms except the first one, we get [2,1,0,0], whose partial sums are [2,3,3,3], and 2*3*3*3 = 54, thus a(44)=54.
		

Crossrefs

For n>=1, a(n) gives the product of nonzero terms on row n of table A227189/A227739.
Cf. A227183 (gives the corresponding sums).
See also A167489 for a similar sequence, which gives the product of parts of the compositions (ordered partitions).
Cf. A243499, A003963, A243504 (other such product sequences) and A003188, A243353, A075157 (associated permutations mapping between these schemes).
Cf. also A002487, A243353, A253552.

Programs

  • Mathematica
    Table[Function[b, Times @@ Accumulate@ Prepend[If[Length@ b > 1, Rest[b] - 1, {}], First@ b]]@ Map[Length, Split@ Reverse@ IntegerDigits[n, 2]], {n, 0, 75}] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • Python
    def A227184(n):
      '''Product of parts of the unique unordered partition encoded in the run lengths of the binary expansion of n.'''
      p = 1
      b = n%2
      i = 1
      while (n != 0):
        n >>= 1
        if ((n%2) == b): i += 1
        else:
          b = n%2
          p *= i
      return(p)
  • Scheme
    (define (A227184 n) (if (zero? n) 1 (apply * (binexp_to_ascpart n))))
    (define (binexp_to_ascpart n) (let ((runlist (reverse! (binexp->runcount1list n)))) (PARTSUMS (cons (car runlist) (map -1+ (cdr runlist))))))
    (define (binexp->runcount1list n) (if (zero? n) (list) (let loop ((n n) (rc (list)) (count 0) (prev-bit (modulo n 2))) (if (zero? n) (cons count rc) (if (eq? (modulo n 2) prev-bit) (loop (floor->exact (/ n 2)) rc (1+ count) (modulo n 2)) (loop (floor->exact (/ n 2)) (cons count rc) 1 (modulo n 2)))))))
    (define (PARTSUMS a) (cdr (reverse! (fold-left (lambda (psums n) (cons (+ n (car psums)) psums)) (list 0) a))))
    

Formula

Can be also obtained by mapping with an appropriate permutation from the products of parts of each partition computed for other enumerations similar to A227739:
a(n) = A243499(A003188(n)).
a(n) = A003963(A243353(n)).
a(n) = A243504(1+A075157(n)).

A227368 a(n) = Index k where A227183(k) for the first time gets value n; the runlength binary code for minimally runlength-encoded unordered partition of size n.

Original entry on oeis.org

0, 1, 2, 5, 4, 9, 8, 17, 16, 23, 32, 39, 40, 71, 72, 87, 80, 151, 144, 167, 160, 295, 288, 327, 320, 351, 576, 607, 640, 671, 672, 1183, 1184, 1311, 1312, 1375, 1344, 2399, 2368, 2655, 2624, 2719, 2688, 4767, 4736, 5279, 5248, 5407, 5376, 5503, 9472, 9599, 10496
Offset: 0

Views

Author

Antti Karttunen, Jul 08 2013

Keywords

Comments

The word "minimally" in the description means that the integer in whose binary representation some unordered partition of n is encoded should be as small as possible. This sequence gives such a minimal integer for each n, which encodes an unordered partition whose sum is n. The details of the encoding system are explained in A227183.
Also, a(n) gives the index of the first row of A227189/A227739 which sums to n.
Project: Find an algorithm which computes a(n) with a more sophisticated method than just by a blind search. This is a kind of an optimization problem for representing n as a special "bit-packed" sum: the smallest summand of size x costs x bits, and its any subsequent usage in the sum costs just one bit each time. Using any additional summand y > x costs (y-x)+1 bits when used first time, and then again additional usages cost only one bit each. Goal: minimize the number of bits needed. If multiple candidates with the same number of bits are found, then the one which results the smallest integer (when interpreted as a binary number) wins.
For any composite n = t*u, the upper bound for the size of a(n) is t+u-1 bits.
A000267(n) seems to give the binary width of a(n+1). Compare to the conjecture given at A227370.

Examples

			   n   a(n)   binary   corresponding partition    sum = n
                       (cf. A227183 for details)
   0     0         0   (0)                          0
   1     1         1   (1)                          1
   2     2        10   (1 + 1)                      2
   3     5       101   (1 + 1 + 1)                  3
   4     4       100   (2 + 2)                      4
   5     9      1001   (1 + 2 + 2)                  5
   6     8      1000   (3 + 3)                      6
   7    17     10001   (1 + 3 + 3)                  7
   8    16     10000   (4 + 4)                      8
   9    23     10111   (3 + 3 + 3)                  9
  10    32    100000   (5 + 5)                     10
  11    39    100111   (3 + 4 + 4)                 11
  12    40    101000   (3 + 3 + 3 + 3)             12
  13    71   1000111   (3 + 5 + 5)                 13
  14    72   1001000   (3 + 3 + 4 + 4)             14
  15    87   1010111   (3 + 3 + 3 + 3 + 3)         15
  16    80   1010000   (4 + 4 + 4 + 4)             16
  17   151  10010111   (3 + 3 + 3 + 4 + 4)         17
  18   144  10010000   (4 + 4 + 5 + 5)             18
  19   167  10100111   (3 + 4 + 4 + 4 + 4)         19
  20   160  10100000   (5 + 5 + 5 + 5)             20
a(5) = 9, because 5 occurs for the first time in A227183 as A227183(9).
Note that for 20, there is for example also a code 175, "10101111" in binary, which results a partition (4 + 4 + 4 + 4 + 4) (= 20), but as 160 < 175, and there are no other partitions of 20 which would result even smaller code number, 160 is the winner (the minimal code), and thus a(20)=160.
A227761 gives the maximum difference between successive parts that occurs in these partitions.
		

Crossrefs

Same sequence sorted into ascending order: A227369.
Cf. also A227183, A227761, A227762.

Programs

  • Python
    def A227368(n):
      '''Index k where A227183(k) for the first time gets value n. A naive implementation.'''
      k = 0
      while(A227183(k) != n): k += 1
      return(k)

Formula

a(n) = A227369(A227370(n)) [See comments and conjecture at A227370]

A227189 Square array A(n>=0,k>=0) where A(n,k) gives the (k+1)-th part of the unordered partition which has been encoded in the binary expansion of n, as explained in A227183. The array is scanned antidiagonally as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), etc.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2
Offset: 0

Views

Author

Antti Karttunen, Jul 06 2013

Keywords

Comments

Discarding the trailing zero terms, on each row n there is a unique partition of integer A227183(n). All possible partitions of finite natural numbers eventually occur. The first partition that sums to n occurs at row A227368(n).
Irregular table A227739 lists only the nonzero terms.

Examples

			The top-left corner of the array:
row #  row starts as
    0  0, 0, 0, 0, 0, ...
    1  1, 0, 0, 0, 0, ...
    2  1, 1, 0, 0, 0, ...
    3  2, 0, 0, 0, 0, ...
    4  2, 2, 0, 0, 0, ...
    5  1, 1, 1, 0, 0, ...
    6  1, 2, 0, 0, 0, ...
    7  3, 0, 0, 0, 0, ...
    8  3, 3, 0, 0, 0, ...
    9  1, 2, 2, 0, 0, ...
   10  1, 1, 1, 1, 0, ...
   11  2, 2, 2, 0, 0, ...
   12  2, 3, 0, 0, 0, ...
   13  1, 1, 2, 0, 0, ...
   14  1, 3, 0, 0, 0, ...
   15  4, 0, 0, 0, 0, ...
   16  4, 4, 0, 0, 0, ...
   17  1, 3, 3, 0, 0, ...
etc.
8 has binary expansion "1000", whose runlengths are [3,1] (the length of the run in the least significant end comes first) which maps to nonordered partition {3+3} as explained in A227183, thus row 8 begins as 3, 3, 0, 0, ...
17 has binary expansion "10001", whose runlengths are [1,3,1] which maps to nonordered partition {1,3,3}, thus row 17 begins as 1, 3, 3, ...
		

Crossrefs

Only nonzero terms: A227739. Row sums: A227183. The product of nonzero terms on row n>0 is A227184(n). Number of nonzero terms on each row: A005811. The leftmost column, after n>0: A136480. The rightmost nonzero term: A227185.
Cf. A227368 and also arrays A227186 and A227188.

Programs

Showing 1-10 of 14 results. Next