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.

Previous Showing 11-20 of 22 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)

A125106 Enumeration of partitions by binary representation: each 1 is a part; the part size is 1 more than the number of 0's in the rest of the number.

Original entry on oeis.org

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

Views

Author

Alford Arnold, Dec 10 2006

Keywords

Comments

Another way to describe this: starting with the binary representation and a counter set at one, count the 0's from right to left. Write a term equal to the counter for each "1" encountered.
A101211 is a similar sequence, with A005811 elements per row which maps natural numbers to compositions (ordered partitions).
There are two ways to consider this as a table: taking each partition as a row, or taking the partitions generated by 2^(n-1) through 2^n-1 as a row.
Taking the n-th row as multiple partitions, it consists of those partitions with the first hook size (largest part plus number of parts minus 1) equal to n. The number of integers in this n-th row is A001792(n-1), and the row sum is A049611.
Taking each partition as a separate row, the row lengths are A000120, and the row sums are A161511.
Heinz numbers of the rows are A005940. - Gus Wiseman, Jan 17 2023

Examples

			Row 4:
1000 [4]
1001 [3,1]
1010 [3,2]
1011 [2,1,1]
1100 [3,3]
1101 [2,2,1]
1110 [2,2,2]
1111 [1,1,1,1]
		

Crossrefs

Each partition as row: A000120 (row widths), A161511 (row sums), A243499 (row products).
Lasts are A001511.
Firsts are A008687.

Programs

  • Maple
    b:= proc(n) local c, l, m; l:=[][]; m:= n; c:=1;
          while m>0 do if irem(m, 2, 'm')=0 then c:= c+1
             else l:= c, l fi
          od; l
        end:
    T:= n-> seq(b(i), i=2^(n-1)..2^n-1):
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    f[k_] := (bits = IntegerDigits[k, 2]; zerosCount = Reverse[ Accumulate[ 1-Reverse[bits] ] ] + 1; Select[ Transpose[ {bits, zerosCount} ], First[#] == 1 & ][[All, 2]]); row[n_] := Table[ f[k], {k, 2^(n-1), 2^n-1}]; Flatten[ Table[ row[n], {n, 1, 5}]] (* Jean-François Alcover, Jan 24 2012 *)
    scc[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Reverse[scc[n]-Range[Length[scc[n]]]+1],{n,0,20}] (* Gus Wiseman, Jan 17 2023 *)

Formula

Partition 2n is partition n with every part size increased by 1; partition 2n+1 is partition n with an additional part of size 1.
T(n,k) = A272020(n,k) - A000120(n) + k. - Gus Wiseman, Jan 17 2023

Extensions

Edited by Franklin T. Adams-Watters, Jun 11 2009

A243499 Product of parts of integer partitions as enumerated in the table A125106.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 1, 4, 3, 6, 2, 9, 4, 8, 1, 5, 4, 8, 3, 12, 6, 12, 2, 16, 9, 18, 4, 27, 8, 16, 1, 6, 5, 10, 4, 15, 8, 16, 3, 20, 12, 24, 6, 36, 12, 24, 2, 25, 16, 32, 9, 48, 18, 36, 4, 64, 27, 54, 8, 81, 16, 32, 1, 7, 6, 12, 5, 18, 10, 20, 4, 24, 15, 30, 8, 45, 16, 32, 3
Offset: 0

Views

Author

Antti Karttunen, Jun 28 2014

Keywords

Comments

This sequence and A341392 have the same set of values on intervals from 2^m to 2^(m+1) - 1 for m >= 0. - Mikhail Kurkov, Jun 18 2021 [verification needed]

Crossrefs

Cf. A125106, A161511 (gives the corresponding sums), A227184, A003963, A243504, A006068, A005940, A163511, A000110, A007814, A023416, A053645, A329369 (similar recurrence), A341392.

Programs

  • Scheme
    (define (A243499 n) (let loop ((n n) (i 1) (p 1)) (cond ((zero? n) p) ((even? n) (loop (/ n 2) (+ i 1) p)) (else (loop (/ (- n 1) 2) i (* p i))))))

Formula

Can also be obtained by mapping with an appropriate permutation from the products of parts of each partition computed for other enumerations similar to A125106:
a(n) = A227184(A006068(n)).
a(n) = A003963(A005940(n+1)).
a(n) = A243504(A163511(n)).
From Mikhail Kurkov, Jul 11 2021: (Start)
a(n) = (1 + A023416(n))*a(A053645(n)) for n > 0 with a(0) = 1.
a(2n+1) = a(n) for n >= 0.
a(2n) = A341392(2*A059894(n)) = a(n - 2^f(n)) + a(2n - 2^f(n)) = (2 + f(n))*a(n - 2^f(n)) for n > 0 with a(0)=1 where f(n) = A007814(n).
Sum_{k=0..2^n - 1} a(k) = A000110(n+1) for n >= 0.
a((4^n - 1)/3) = n! for n >= 0.
a(2^m*(2^n - 1)) = (m+1)^n for n >= 0, m >= 0. (End) [verification needed]

A359043 Sum of adjusted partial sums of the n-th composition in standard order (A066099). Row sums of A242628.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 21 2022

Keywords

Comments

We define the adjusted partial sums of a composition to be obtained by subtracting one from all parts, taking partial sums, and adding one back to all parts.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The 29th composition in standard order is (1,1,2,1), with adjusted partial sums (1,1,2,2), with sum 6, so a(29) = 6.
		

Crossrefs

See link for sequences related to standard compositions.
The unadjusted reverse version is A029931, row sums of A048793.
The reverse version is A161511, row sums of A125106.
Row sums of A242628, ranked by A253565.
The unadjusted version is A359042, row sums of A358134.
A011782 counts compositions.
A066099 lists standard compositions.
A358135 gives last minus first of standard compositions.
A358194 counts partitions by sum and weighted sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[Accumulate[stc[n]-1]+1],{n,0,100}]

A161924 Permutation of natural numbers: sequence A126441 without zeros.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 6, 11, 15, 16, 17, 10, 19, 13, 23, 31, 32, 33, 18, 35, 12, 21, 14, 39, 27, 47, 63, 64, 65, 34, 67, 20, 37, 22, 71, 25, 43, 29, 79, 55, 95, 127, 128, 129, 66, 131, 36, 69, 38, 135, 24, 41, 26, 75, 45, 30, 143, 51, 87, 59, 159, 111, 191, 255, 256
Offset: 1

Views

Author

Alford Arnold, Jun 23 2009

Keywords

Comments

Values appear in the order determined by A004760(n+1)and A062383(n).
The graph of this sequence looks very elegant.

Examples

			The table begins:
1.2.4..8.16.32.64.128.256.512.1024
..3.5..9.17.33.65.129.257.513.1025
.......6.10.18.34..66.130.258..514
....7.11.19.35.67.131.259.515.1027
............12.20..36..68.132..260
.........13.21.37..69.133.261..517
............14.22..38..70.134..262
......15.23.39.71.135.263.519.1031
...................24..40..72..136
...............25..41..73.137..265
...................26..42..74..138
............27.43..75.139.267..523
.......................28..44...76
...............29..45..77.141..269
...................30..46..78..142
.........31.47.79.143.271.527.1039
...........................48...80
.......................49..81..145
...........................50...82
...................51..83.147..275
This can be viewed as an irregular table, where row r (>= 1) has A000041(r) elements, that is, as 1; 2,3; 4,5,7; 8,9,6,11,15; 16,17,10,19,13,23,31; etc. A125106 illustrates how each number is mapped to a partition.
		

Crossrefs

Inverse: A166276. a(n) = A126441(A166274(n)). See A161919 for the version with each row sorted into ascending order.
A161511(a(n)) = A036042(n).

Programs

  • Mathematica
    columns = 9; row[n_] := n - 2^Floor[Log2[n]]; col[0] = 0; col[n_] := If[EvenQ[n], col[n/2] + DigitCount[n/2, 2, 1], col[(n - 1)/2] + 1]; Clear[T]; T[, ] = 0; Do[T[row[k], col[k]] = k, {k, 1, 2^columns}]; Table[DeleteCases[Table[T[n - 1, k], {n, 1, 2^(k - 1)}], 0], {k, 1, columns}] // Flatten (* Jean-François Alcover, Sep 09 2017 *)

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A055941 a(n) = Sum_{j=0..k-1} (i(j) - j) where n = Sum_{j=0..k-1} 2^i(j).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 0, 3, 2, 3, 1, 4, 2, 3, 0, 4, 3, 4, 2, 5, 3, 4, 1, 6, 4, 5, 2, 6, 3, 4, 0, 5, 4, 5, 3, 6, 4, 5, 2, 7, 5, 6, 3, 7, 4, 5, 1, 8, 6, 7, 4, 8, 5, 6, 2, 9, 6, 7, 3, 8, 4, 5, 0, 6, 5, 6, 4, 7, 5, 6, 3, 8, 6, 7, 4, 8, 5, 6, 2, 9, 7, 8, 5, 9, 6, 7, 3, 10, 7, 8, 4, 9, 5, 6, 1, 10, 8, 9, 6, 10, 7, 8, 4
Offset: 0

Views

Author

Anno Siegel (siegel(AT)zrz.tu-berlin.de), Jul 18 2000

Keywords

Comments

Used to calculate number of subspaces of Zp^n where Zp is field of integers mod p.
Consider a square matrix A and call it special if (0) A is an upper triangular matrix, (1) a nonzero column of A has a 1 on the main diagonal and (2) if a row has a 1 on the main diagonal then this is the only nonzero element in that row.
If the diagonal of a special matrix is given (it can only contain 0's and 1's), many of the fields of A are determined by (0), (1) and (2). The number of fields that can be freely chosen while still satisfying (0), (1) and (2) is a(n), where n is the diagonal, read as a binary number with least significant bit at upper left.
a(n) is also the minimum number of adjacent bit swap operations required to pack all the ones of n to the right. - Philippe Beaudoin, Aug 19 2014
From Rakesh Khanna A, Aug 06 2021: (Start)
a(n) is also the area under the curve formed from the binary representation of n where each 0-bit corresponds to an increase of one unit along the x-axis and each 1-bit corresponds to an increase of one unit along the y-axis.
E.g., n = 20 = 10100_2 and the area under the curve shown below is a(n) = 5.
1 0 1 0 0
\ \ \ \ \ |
\ \ \+----+----+
\ \ | |
\+----+ +
| |
----+----+----+----+
(End)

Examples

			20 = 2^4 + 2^2, thus a(20) = (2-0) + (4-1) = 5.
		

References

  • A. Siegel, Linear Aspects of Boolean Functions, 1999 (unpublished).

Crossrefs

Programs

  • Mathematica
    b[n_] := b[n] = If[n == 0, 0, If[EvenQ[n], b[n/2] + DigitCount[n/2, 2, 1], b[(n - 1)/2] + 1]];
    a[n_] := b[n] - DigitCount[n, 2, 1];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Sep 23 2018 *)
  • PARI
    a(n) = {my(b=binary(n)); nb = 0; for (i=1, #b-1, if (b[i], nb += sum(j=i+1, #b, !b[j]));); nb;} \\ Michel Marcus, Aug 12 2014
    
  • Python
    def A055941(n):
        s = bin(n)[2:]
        return sum(s[i:].count('0') for i,d in enumerate(s,start=1) if d == '1')
    # Chai Wah Wu, Sep 07 2014

Formula

a(n) = Sum (total number of 0-bits to the right of 1-bit) over all 1-bits of n.
a(n) = A161511(n) - A000120(n) = A161920(n+1) - 1 - A029837(n+1).
a(n) = 0 if A241816(n) = n; 1 + a(A241816(n)) otherwise. - Philippe Beaudoin, Aug 19 2014

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A358195 Heinz number of the partial sums plus one of the reversed first differences of the prime indices of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 9, 1, 7, 3, 8, 1, 6, 1, 25, 5, 11, 1, 27, 2, 13, 4, 49, 1, 15, 1, 16, 7, 17, 3, 18, 1, 19, 11, 125, 1, 35, 1, 121, 9, 23, 1, 81, 2, 10, 13, 169, 1, 12, 5, 343, 17, 29, 1, 75, 1, 31, 25, 32, 7, 77, 1, 289, 19, 21, 1, 54, 1, 37
Offset: 1

Views

Author

Gus Wiseman, Dec 23 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The partial sums of first differences of a sequence telescope to "rest minus first", leading to the formula.

Examples

			The prime indices of 36 are (1,1,2,2), differences (0,1,0), reversed (0,1,0), partial sums (0,1,1), plus one (1,2,2), Heinz number 18, so a(36) = 18.
		

Crossrefs

The even bisection is A241916.
The unreversed version is A246277.
Sum of prime indices of a(n) is A326844(n) + A001222(n) - 1.
A048793 gives partial sums of reversed standard comps, Heinz number A019565.
A112798 list prime indices, sum A056239.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    osq[q_]:=1+Accumulate[Reverse[Differences[q]]];
    Table[Times@@Prime/@osq[primeMS[n]],{n,20}]

Formula

If n = Product_{i=1..k} prime(x_i) then a(n) = Product_{i=1..k-1} prime(x_k-x_{k-i}+1).

A290253 Triangle read by rows. Row n consists of the parts, ordered nonincreasingly, of the integer partition having viabin number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Aug 23 2017

Keywords

Comments

The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20.
Number of entries in row n is A290251(n).
In the Maple program the command vitopart(n) yields the integer partition having viabin number n.

Examples

			Row 25 is 3,2,2. Indeed, the binary form of 25 is 11001. Consequently, the southeast border of the Ferrers board of the associated partition is EENNEN, where E and N are the steps [1,0] and [0,1], respectively. This leads to the partition [3,2,2].
Triangle begins:
0,
1;
1,1;
2;
1,1,1;
2,1;
2,2;
3;
		

Crossrefs

Row sums give A161511.
Row lengths give A008687(n+1).

Programs

  • Maple
    # (due to W. Edwin Clark)
    vitopart := proc (n) local L, i, j, N, p, t; N := 2*n; L := ListTools:-Reverse(convert(N, base, 2)); j := 0; for i to nops(L) do if L[i] = 0 then j := j+1; p[j] := numboccur(L[1 .. i], 1) end if end do; sort([seq(p[t], t = 1 .. j)], `>=`) end proc:
    # second Maple program:
    T:= proc(n) local m; m:= n; [0]; while m>0 do `if`(1=
          irem(m, 2, 'm'), map(x-> x+1, %), [%[], 0]) od: %[]
        end:
    seq(T(n), n=0..50);  # Alois P. Heinz, Aug 23 2017
  • Mathematica
    T[n_] := Module[{L = IntegerDigits[2n, 2], j = 0, p}, Do[If[L[[i]] == 0, j++; p[j] = Count[L[[;;i]], 1]], {i, 1, Length[L]}]; Array[p, j] // Reverse];
    Table[T[n], {n, 0, 50}] // Flatten (* Jean-François Alcover, Aug 06 2024, after W. Edwin Clark *)

A161919 Permutation of natural numbers: concatenation of subsequences A161924(A000070(k-1)..A026905(k)), k >= 1, each sorted into ascending order.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 8, 9, 11, 15, 10, 13, 16, 17, 19, 23, 31, 12, 14, 18, 21, 27, 32, 33, 35, 39, 47, 63, 20, 22, 25, 29, 34, 37, 43, 55, 64, 65, 67, 71, 79, 95, 127, 24, 26, 30, 36, 38, 41, 45, 51, 59, 66, 69, 75, 87, 111, 128, 129, 131, 135, 143, 159, 191, 255, 28, 40
Offset: 1

Views

Author

Alford Arnold, Jun 23 2009

Keywords

Comments

This is the lexicographically earliest sequence a_n for which it holds that A161511(a(n)) = A036042(n) for all n.
Triangle T(n,k) read by rows. Row n lists in increasing order the viabin numbers of the integer partitions of n (n >= 1, k >= 1). The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [3,1,1] of 5. The southeast border of its Ferrers board yields 10011, leading to the viabin number 19 (an entry in the 5th row). - Emeric Deutsch, Sep 06 2017
After specifying the value of n, the first Maple program yields the entries of row n. - Emeric Deutsch, Feb 26 2016
After specifying the value of m, the third Maple program yields the first m rows; the command partovi(p) yields the viabin number of the partition p = [a,b,c,...]. - Emeric Deutsch, Aug 31 2017

Examples

			This can be viewed as an irregular table, where row r (>= 1) has A000041(r) elements, i.e., as 1; 2,3; 4,5,7; 6,8,9,11,15; 10,13,16,17,19,23,31; etc. A125106 illustrates how each number is mapped to a partition.
		

Crossrefs

Inverse: A166277. Sequence A161924 gives the same rows before sorting.

Programs

  • Maple
    n := 11: s := proc (b) local t, i, j: t := 0: for i to nops(b) do for j from i+1 to nops(b) do if b[j]-b[i] = 1 then t := t+1 else  end if end do end do: t end proc: A[n] := {}: for i to 2^n do a[i] := convert(2*i, base, 2) end do: for k to 2^n do if s(a[k]) = n then A[n] := `union`(A[n], {k}) else  end if end do: A[n]; # Emeric Deutsch, Feb 26 2016
    # second Maple program:
    f:= proc(l) local i, r; r:= 0; for i to nops(l)-1 do
           r:= 2*((x-> 2*x+1)@@(l[i+1]-l[i]))(r) od; r/2
        end:
    b:= proc(n, i) `if`(n=0 or i=1, [[0, 1$n]], [b(n, i-1)[],
          `if`(i>n, [], map(x-> [x[], i], b(n-i, i)))[]])
        end:
    T:= n-> sort(map(f, b(n$2)))[]:
    seq(T(n), n=1..10);  # Alois P. Heinz, Jul 25 2017
    # 3rd Maple program:
    m := 10; with(combinat): ff := proc (X) local s: s := [1, seq(0, j = 1 .. X[2])]: s := map(convert, s, string): return cat(op(s)) end proc: partovi := proc (P) local X, n, Y, i: X := convert(P, multiset): n := X[-1][1]: Y := map(proc (t) options operator, arrow: t[1] end proc, X): for i to n do if member(i, Y) = false then X := [op(X), [i, 0]] end if end do: X := sort(X, proc (s, t) options operator, arrow: evalb(s[1] < t[1]) end proc): X := map(ff, X): X := cat(op(X)): n := parse(X): n := convert(n, decimal, binary): (1/2)*n end proc: for n to m do {seq(partovi(partition(n)[q]), q = 1 .. numbpart(n))} end do; # Emeric Deutsch, Aug 31 2017
  • Mathematica
    columns = 10;
    row[n_] := n - 2^Floor[Log2[n]];
    col[0] = 0; col[n_] := If[EvenQ[n], col[n/2] + DigitCount[n/2, 2, 1], col[(n-1)/2] + 1];
    Clear[T]; T[, ] = 0; Do[T[row[k], col[k]] = k, {k, 1, 2^columns}];
    Table[DeleteCases[Sort @ Table[T[n-1, k], {n, 1, 2^(k-1)}], 0], {k, 1, columns}] // Flatten (* Jean-François Alcover, Feb 16 2021 *)

Extensions

Edited and extended by Antti Karttunen, Oct 12 2009

A167979 Linearize the arrays A099627 A124922 ... defined in A167204 and based on A161924 then concatenate to form a new table.

Original entry on oeis.org

1, 2, 6, 3, 10, 12, 4, 13, 20, 14, 5, 18, 25, 22, 24, 7, 21, 36, 29, 40, 26, 8, 27, 41, 38, 49, 42, 28, 9, 34, 51, 45, 72, 53, 44, 30, 11, 37, 68, 59, 81, 74, 57, 46, 48, 15, 43, 73, 70, 99, 85, 76, 61, 80, 50, 16, 55, 83, 77, 136, 107, 89, 78, 97, 82, 52
Offset: 1

Views

Author

Alford Arnold, Nov 15 2009

Keywords

Comments

Contribution from Alford Arnold, Nov 29 2009: (Start)
Note that the values within A167977 identify the number partitioned described in A125106 and A161924.
(End)

Examples

			The resulting table begins:
..1..2..3..4..5..7..8
..6.10.13.18.21.27
.12.20.25.36.41
.14.22.29.38
etc.
Contribution from _Alford Arnold_, Nov 29 2009: 4 equals 2+2 which maps to the natural number 6 (binary 110) and 6 appears in the second array (A124922).
		

Crossrefs

Contribution from Alford Arnold, Nov 29 2009: (Start)
A125106(Describes the mapping to partitions). A167977 is A161511(A167979).
(End)

Extensions

Corrected By Alford Arnold, Nov 29 2009
Previous Showing 11-20 of 22 results. Next