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-9 of 9 results.

A228100 Triangle in which n-th row lists all partitions of n, such that partitions of n into m parts appear in lexicographic order previous to the partitions of n into k parts if k < m. (Fenner-Loizou tree.)

Original entry on oeis.org

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

Views

Author

Peter Luschny, Aug 10 2013

Keywords

Comments

First differs from A193073 at a(58). - Omar E. Pol, Sep 22 2013
The partition lengths appear to be A331581. - Gus Wiseman, May 12 2020

Examples

			The sixth row is:
[1, 1, 1, 1, 1, 1]
[2, 1, 1, 1, 1]
[2, 2, 1, 1]
[3, 1, 1, 1]
[2, 2, 2]
[3, 2, 1]
[4, 1, 1]
[3, 3]
[4, 2]
[5, 1]
[6]
From _Gus Wiseman_, May 10 2020: (Start)
The triangle with partitions shown as Heinz numbers (A333485) begins:
    1
    2
    4   3
    8   6   5
   16  12   9  10   7
   32  24  18  20  15  14  11
   64  48  36  40  27  30  28  25  21  22  13
  128  96  72  80  54  60  56  45  50  42  44  35  33  26  17
(End)
		

References

  • T. I. Fenner, G. Loizou: A binary tree representation and related algorithms for generating integer partitions. The Computer J. 23(4), 332-337 (1980)
  • D. E. Knuth: The Art of Computer Programming. Generating all combinations and partitions, vol. 4, fasc. 3, 7.2.1.4, exercise 10.
  • K. Yamanaka, Y. Otachi, Sh. Nakano: Efficient enumeration of ordered trees with k leaves. In: WALCOM: Algorithms and Computation, Lecture Notes in Computer Science Volume 5431, 141-150 (2009)
  • S. Zaks, D. Richards: Generating trees and other combinatorial objects lexicographically. SIAM J. Comput. 8(1), 73-81 (1979)
  • A. Zoghbi, I. Stojmenovic': Fast algorithms for generating integer partitions. Int. J. Comput. Math. 70, 319-332 (1998)

Crossrefs

See A036036 for the Hindenburg (graded reflected colexicographic) ordering.
See A036037 for the graded colexicographic ordering.
See A080576 for the Maple (graded reflected lexicographic) ordering.
See A080577 for the Mathematica (graded reverse lexicographic) ordering.
See A182937 the Fenner-Loizou (binary tree in preorder traversal) ordering.
See A193073 for the graded lexicographic ordering.
The version for compositions is A296773.
Taking Heinz numbers gives A333485.
Lexicographically ordered reversed partitions are A026791.
Sorting partitions by Heinz number gives A296150, or A112798 for reversed partitions.
Reversed partitions under the (sum/length/revlex) ordering are A334302.

Programs

  • Maple
    b:= proc(n, i) b(n, i):= `if`(n=0 or i=1, [[1$n]], [b(n, i-1)[],
          `if`(i>n, [], map(x-> [i, x[]], b(n-i, i)))[]])
        end:
    T:= n-> map(h-> h[], sort(b(n$2), proc(x, y) local i;
            if nops(x)<>nops(y) then return nops(x)>nops(y) else
            for i to nops(x) do if x[i]<>y[i] then return x[i]Alois P. Heinz, Aug 13 2013
  • Mathematica
    row[n_] := Flatten[Reverse[Sort[#]]& /@ SplitBy[Sort[IntegerPartitions[n] ], Length], 1] // Reverse; Array[row, 8] // Flatten (* Jean-François Alcover, Dec 05 2016 *)
    ralensort[f_,c_]:=If[Length[f]!=Length[c],Length[f]>Length[c],OrderedQ[{f,c}]];
    Join@@Table[Sort[IntegerPartitions[n],ralensort],{n,0,8}] (* Gus Wiseman, May 10 2020 *)
  • Sage
    from collections import deque
    def GeneratePartitions(n, visit):
        p = ([], 0, n)
        queue = deque()
        queue.append(p)
        visit(p)
        while len(queue) > 0 :
            (phead, pheadLen, pnum1s) = queue.popleft()
            if pnum1s != 1 :
                head = phead[:pheadLen] + [2]
                q = (head, pheadLen + 1, pnum1s - 2)
                if 1 <= q[2] : queue.append(q)
                visit(q)
            if pheadLen == 1 or (pheadLen > 1 and \
                          (phead[pheadLen - 1] != phead[pheadLen - 2])) :
                head = phead[:pheadLen]
                head[pheadLen - 1] += 1
                q = (head, pheadLen, pnum1s - 1)
                if 1 <= q[2] : queue.append(q)
                visit(q)
    def visit(q): print(q[0] + [1 for i in range(q[2])])
    for n in (1..7): GeneratePartitions(n, visit)

A344086 Flattened tetrangle of strict integer partitions sorted first by sum, then lexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 11 2021

Keywords

Comments

The zeroth row contains only the empty partition.
A tetrangle is a sequence of finite triangles.

Examples

			Tetrangle begins:
  0: ()
  1: (1)
  2: (2)
  3: (21)(3)
  4: (31)(4)
  5: (32)(41)(5)
  6: (321)(42)(51)(6)
  7: (421)(43)(52)(61)(7)
  8: (431)(521)(53)(62)(71)(8)
  9: (432)(531)(54)(621)(63)(72)(81)(9)
		

Crossrefs

Positions of first appearances are A015724.
Triangle sums are A066189.
Taking revlex instead of lex gives A118457.
The not necessarily strict version is A193073.
The version for reversed partitions is A246688.
The Heinz numbers of these partitions grouped by sum are A246867.
The ordered generalization is A339351.
Taking colex instead of lex gives A344087.
A026793 gives reversed strict partitions in A-S order (sum/length/lex).
A319247 sorts reversed strict partitions by Heinz number.
A329631 sorts strict partitions by Heinz number.
A344090 gives strict partitions in A-S order (sum/length/lex).

Programs

  • Mathematica
    lexsort[f_,c_]:=OrderedQ[PadRight[{f,c}]];
    Table[Sort[Select[IntegerPartitions[n],UnsameQ@@#&],lexsort],{n,0,8}]

A333483 Sort all positive integers, first by sum of prime indices (A056239), then by number of prime indices (A001222).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 12, 16, 11, 14, 15, 18, 20, 24, 32, 13, 21, 22, 25, 27, 28, 30, 36, 40, 48, 64, 17, 26, 33, 35, 42, 44, 45, 50, 54, 56, 60, 72, 80, 96, 128, 19, 34, 39, 49, 55, 52, 63, 66, 70, 75, 81, 84, 88, 90, 100, 108, 112, 120, 144, 160, 192, 256, 23, 38, 51, 65, 77, 68, 78, 98, 99, 105, 110, 125, 104, 126, 132, 135, 140, 150, 162, 168, 176, 180, 200, 216, 224, 240, 288, 320, 384, 512
Offset: 0

Views

Author

Gus Wiseman, May 10 2020

Keywords

Comments

A refinement of A215366, from which it first differs at a(49) = 55, A215366(49) = 52.
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.

Examples

			Triangle begins:
   1
   2
   3   4
   5   6   8
   7   9  10  12  16
  11  14  15  18  20  24  32
  13  21  22  25  27  28  30  36  40  48  64
  17  26  33  35  42  44  45  50  54  56  60  72  80  96 128
		

Crossrefs

Row lengths are A000041.
Ignoring length gives A215366 (graded Heinz numbers).
Sorting by decreasing length gives A333484.
Finally sorting lexicographically by prime indices gives A185974.
Finally sorting colexicographically by prime indices gives A334433.
Finally sorting reverse-lexicographically by prime indices gives A334435.
Finally sorting reverse-colexicographically by prime indices gives A334438.
Number of prime indices is A001222.
Reversed partitions in Abramowitz-Stegun (sum/length/lex) order are A036036.
Partitions in (sum/length/colex) order are A036037.
Sum of prime indices is A056239.
Sorting reversed partitions by Heinz number gives A112798.
Sorting partitions by Heinz number gives A296150.

Programs

  • Mathematica
    Join@@@Table[Sort[Times@@Prime/@#&/@IntegerPartitions[n,{k}]],{n,0,8},{k,0,n}]

A333485 Heinz numbers of all integer partitions sorted first by sum, then by decreasing length, and finally lexicographically. A code for the Fenner-Loizou tree A228100.

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 5, 16, 12, 9, 10, 7, 32, 24, 18, 20, 15, 14, 11, 64, 48, 36, 40, 27, 30, 28, 25, 21, 22, 13, 128, 96, 72, 80, 54, 60, 56, 45, 50, 42, 44, 35, 33, 26, 17, 256, 192, 144, 160, 108, 120, 112, 81, 90, 100, 84, 88, 75, 63, 70, 66, 52, 49, 55, 39, 34, 19
Offset: 0

Views

Author

Gus Wiseman, May 11 2020

Keywords

Comments

A permutation of the positive integers.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), which gives a bijective correspondence between positive integers and integer partitions.
As a triangle with row lengths A000041, the sequence starts {{1},{2},{4,3},{8,6,5},...}, so offset is 0.

Examples

			The sequence of terms together with their prime indices begins:
    1: {}              11: {5}                 56: {1,1,1,4}
    2: {1}             64: {1,1,1,1,1,1}       45: {2,2,3}
    4: {1,1}           48: {1,1,1,1,2}         50: {1,3,3}
    3: {2}             36: {1,1,2,2}           42: {1,2,4}
    8: {1,1,1}         40: {1,1,1,3}           44: {1,1,5}
    6: {1,2}           27: {2,2,2}             35: {3,4}
    5: {3}             30: {1,2,3}             33: {2,5}
   16: {1,1,1,1}       28: {1,1,4}             26: {1,6}
   12: {1,1,2}         25: {3,3}               17: {7}
    9: {2,2}           21: {2,4}              256: {1,1,1,1,1,1,1,1}
   10: {1,3}           22: {1,5}              192: {1,1,1,1,1,1,2}
    7: {4}             13: {6}                144: {1,1,1,1,2,2}
   32: {1,1,1,1,1}    128: {1,1,1,1,1,1,1}    160: {1,1,1,1,1,3}
   24: {1,1,1,2}       96: {1,1,1,1,1,2}      108: {1,1,2,2,2}
   18: {1,2,2}         72: {1,1,1,2,2}        120: {1,1,1,2,3}
   20: {1,1,3}         80: {1,1,1,1,3}        112: {1,1,1,1,4}
   15: {2,3}           54: {1,2,2,2}           81: {2,2,2,2}
   14: {1,4}           60: {1,1,2,3}           90: {1,2,2,3}
The triangle begins:
    1
    2
    4   3
    8   6   5
   16  12   9  10   7
   32  24  18  20  15  14  11
   64  48  36  40  27  30  28  25  21  22  13
  128  96  72  80  54  60  56  45  50  42  44  35  33  26  17
		

Crossrefs

Row lengths are A000041.
The constructive version is A228100.
Sorting by increasing length gives A334433.
The version with rows reversed is A334438.
Sum of prime indices is A056239.
Reverse-lexicographically ordered partitions are A080577.
Sorting reversed partitions by Heinz number gives A112798.
Lexicographically ordered partitions are A193073.
Graded Heinz numbers are A215366.
Sorting partitions by Heinz number gives A296150.
If the fine ordering is by Heinz number instead of lexicographic we get A333484.

Programs

  • Mathematica
    ralensort[f_,c_]:=If[Length[f]!=Length[c],Length[f]>Length[c],OrderedQ[{f,c}]];
    Join@@Table[Times@@Prime/@#&/@Sort[IntegerPartitions[n],ralensort],{n,0,8}]

Formula

A001221(a(n)) = A115623(n).
A001222(a(n - 1)) = A331581(n).
A061395(a(n > 1)) = A128628(n).

Extensions

Name extended by Peter Luschny, Dec 23 2020

A344089 Flattened tetrangle of reversed strict integer partitions, sorted first by length and then colexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 12 2021

Keywords

Comments

First differs from the revlex (instead of colex) version for partitions of 12.
The zeroth row contains only the empty partition.
A tetrangle is a sequence of finite triangles.

Examples

			Tetrangle begins:
  0: ()
  1: (1)
  2: (2)
  3: (3)(12)
  4: (4)(13)
  5: (5)(23)(14)
  6: (6)(24)(15)(123)
  7: (7)(34)(25)(16)(124)
  8: (8)(35)(26)(17)(134)(125)
  9: (9)(45)(36)(27)(18)(234)(135)(126)
		

Crossrefs

Positions of first appearances are A015724 plus one.
Taking lex instead of colex gives A026793 (non-reversed: A118457).
Triangle sums are A066189.
Reversing all partitions gives A344090.
The non-strict version is A344091.
A319247 sorts strict partitions by Heinz number.
A329631 sorts reversed strict partitions by Heinz number.

Programs

  • Mathematica
    Table[Reverse/@Sort[Select[IntegerPartitions[n],UnsameQ@@#&]],{n,0,30}]

A344085 Triangle of squarefree numbers first grouped by greatest prime factor, then sorted by omega, then in increasing order, read by rows.

Original entry on oeis.org

1, 2, 3, 6, 5, 10, 15, 30, 7, 14, 21, 35, 42, 70, 105, 210, 11, 22, 33, 55, 77, 66, 110, 154, 165, 231, 385, 330, 462, 770, 1155, 2310, 13, 26, 39, 65, 91, 143, 78, 130, 182, 195, 273, 286, 429, 455, 715, 1001, 390, 546, 858, 910, 1365, 1430, 2002, 2145, 3003, 5005, 2730, 4290, 6006, 10010, 15015, 30030
Offset: 1

Views

Author

Gus Wiseman, May 11 2021

Keywords

Comments

Differs from A339195 in having 77 before 66.

Examples

			Triangle begins:
   1
   2
   3   6
   5  10  15  30
   7  14  21  35  42  70 105 210
		

Crossrefs

Programs

  • Mathematica
    nn=4;
    GatherBy[SortBy[Select[Range[Times@@Prime/@Range[nn]],SquareFreeQ[#]&&PrimePi[FactorInteger[#][[-1,1]]]<=nn&],PrimeOmega],FactorInteger[#][[-1,1]]&]

A344087 Flattened tetrangle of strict integer partitions sorted first by sum, then colexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 11 2021

Keywords

Comments

The zeroth row contains only the empty partition.
A tetrangle is a sequence of finite triangles.

Examples

			Tetrangle begins:
  0: ()
  1: (1)
  2: (2)
  3: (21)(3)
  4: (31)(4)
  5: (41)(32)(5)
  6: (321)(51)(42)(6)
  7: (421)(61)(52)(43)(7)
  8: (521)(431)(71)(62)(53)(8)
  9: (621)(531)(81)(432)(72)(63)(54)(9)
		

Crossrefs

Positions of first appearances are A015724.
Triangle sums are A066189.
Taking revlex instead of colex gives A118457.
The not necessarily strict version is A211992.
Taking lex instead of colex gives A344086.
A026793 gives reversed strict partitions in A-S order (sum/length/lex).
A319247 sorts strict partitions by Heinz number.
A329631 sorts reversed strict partitions by Heinz number.
A344090 gives strict partitions in A-S order (sum/length/lex).

Programs

  • Mathematica
    colex[f_,c_]:=OrderedQ[PadRight[{Reverse[f],Reverse[c]}]];
    Table[Sort[Select[IntegerPartitions[n],UnsameQ@@#&],colex],{n,0,10}]

A344088 Flattened tetrangle of reversed strict integer partitions sorted first by sum, then colexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 12 2021

Keywords

Comments

The zeroth row contains only the empty partition.
A tetrangle is a sequence of finite triangles.

Examples

			Tetrangle begins:
  0: ()
  1: (1)
  2: (2)
  3: (12)(3)
  4: (13)(4)
  5: (23)(14)(5)
  6: (123)(24)(15)(6)
  7: (124)(34)(25)(16)(7)
  8: (134)(125)(35)(26)(17)(8)
  9: (234)(135)(45)(126)(36)(27)(18)(9)
		

Crossrefs

Positions of first appearances are A015724.
Triangle sums are A066189.
The non-strict version is A080576.
Taking lex instead of colex gives A246688 (non-reversed: A344086).
The non-reversed version is A344087.
Taking revlex instead of colex gives A344089 (non-reversed: A118457).
A026793 gives reversed strict partitions in A-S order (sum/length/lex).
A319247 sorts strict partitions by Heinz number.
A329631 sorts reversed strict partitions by Heinz number.
A344090 gives strict partitions in A-S order (sum/length/lex).

Programs

  • Mathematica
    colex[f_,c_]:=OrderedQ[PadRight[{Reverse[f],Reverse[c]}]];
    Table[Sort[Reverse/@Select[IntegerPartitions[n],UnsameQ@@#&],colex],{n,0,10}]

A344084 Concatenated list of all finite nonempty sets of positive integers sorted first by maximum, then by length, and finally lexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 11 2021

Keywords

Examples

			The sets are the columns below:
  1 2 1 3 1 2 1 4 1 2 3 1 1 2 1 5 1 2 3 4 1 1 1 2 2 3 1
      2   3 3 2   4 4 4 2 3 3 2   5 5 5 5 2 3 4 3 4 4 2
              3         4 4 4 3           5 5 5 5 5 5 3
                              4                       5
As a tetrangle, the first four triangles are:
  {1}
  {2},{1,2}
  {3},{1,3},{2,3},{1,2,3}
  {4},{1,4},{2,4},{3,4},{1,2,4},{1,3,4},{2,3,4},{1,2,3,4}
		

Crossrefs

Triangle lengths are A000079.
Triangle sums are A001793.
Positions of first appearances are A005183.
Set maxima are A070939.
Set lengths are A124736.

Programs

  • Mathematica
    SortBy[Rest[Subsets[Range[5]]],Last]
Showing 1-9 of 9 results.