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 21-30 of 32 results. Next

A335122 Irregular triangle whose reversed rows are all integer partitions in graded reverse-lexicographic order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 24 2020

Keywords

Comments

First differs from A036036 for partitions of 6.
First differs from A334442 for partitions of 6.
Also reversed partitions in reverse-colexicographic order.

Examples

			The sequence of all reversed partitions begins:
  ()         (1,1,3)        (7)              (8)
  (1)        (1,2,2)        (1,6)            (1,7)
  (2)        (1,1,1,2)      (2,5)            (2,6)
  (1,1)      (1,1,1,1,1)    (1,1,5)          (1,1,6)
  (3)        (6)            (3,4)            (3,5)
  (1,2)      (1,5)          (1,2,4)          (1,2,5)
  (1,1,1)    (2,4)          (1,1,1,4)        (1,1,1,5)
  (4)        (1,1,4)        (1,3,3)          (4,4)
  (1,3)      (3,3)          (2,2,3)          (1,3,4)
  (2,2)      (1,2,3)        (1,1,2,3)        (2,2,4)
  (1,1,2)    (1,1,1,3)      (1,1,1,1,3)      (1,1,2,4)
  (1,1,1,1)  (2,2,2)        (1,2,2,2)        (1,1,1,1,4)
  (5)        (1,1,2,2)      (1,1,1,2,2)      (2,3,3)
  (1,4)      (1,1,1,1,2)    (1,1,1,1,1,2)    (1,1,3,3)
  (2,3)      (1,1,1,1,1,1)  (1,1,1,1,1,1,1)  (1,2,2,3)
We have the following tetrangle of reversed partitions:
                             0
                            (1)
                          (2)(11)
                        (3)(12)(111)
                   (4)(13)(22)(112)(1111)
             (5)(14)(23)(113)(122)(1112)(11111)
  (6)(15)(24)(114)(33)(123)(1113)(222)(1122)(11112)(111111)
		

Crossrefs

Row lengths are A000041.
The version for reversed partitions is A026792.
The version for colex instead of revlex is A026791.
The version for lex instead of revlex is A080576.
The non-reflected version is A080577.
The number of distinct parts is A115623.
Taking Heinz numbers gives A129129.
The version for compositions is A228351.
Partition lengths are A238966.
Partition maxima are A331581.
The length-sensitive version is A334442.
Lexicographically ordered partitions are A193073.
Partitions in colexicographic order are A211992.

Programs

  • Mathematica
    revlexsort[f_,c_]:=OrderedQ[PadRight[{c,f}]];
    Reverse/@Join@@Table[Sort[IntegerPartitions[n],revlexsort],{n,0,8}]

A181317 Triangle in which n-th row lists all partitions of n, in the order of increasing smallest numbers of prime signatures.

Original entry on oeis.org

1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 4, 3, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 5, 4, 1, 3, 2, 3, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 1, 4, 2, 3, 3, 4, 1, 1, 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, 7, 6, 1, 5, 2, 4, 3, 5, 1, 1, 4, 2, 1, 3, 3, 1, 4, 1, 1, 1, 3, 2, 2, 3, 2, 1, 1, 2
Offset: 1

Views

Author

Alois P. Heinz, Jan 26 2011

Keywords

Comments

The parts of each partition are listed in decreasing order.
Differs from A080577 at a(48) and from A036037 at a(56). A181087 uses the same order for all partitions.

Examples

			[3,1,1,1] and [2,2,2] are both partitions of 6, the smallest numbers having these prime signatures are 2^3*3^1*5^1*7^1=840 and 2^2*3^2*5^2=900, thus [3,1,1,1] < [2,2,2] in this order.
Triangle begins:
  [1];
  [2], [1,1];
  [3], [2,1], [1,1,1];
  [4], [3,1], [2,2], [2,1,1], [1,1,1,1];
  [5], [4,1], [3,2], [3,1,1], [2,2,1], [2,1,1,1], [1,1,1,1,1];
  [6], [5,1], [4,2], [3,3], [4,1,1], [3,2,1], [3,1,1,1], [2,2,2];
  ...
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local b, ll;  # gives all parts of partitions of row n
      b:= proc(n,i,l)
            if n<0 then
          elif n=0 then ll:= ll, [mul(ithprime(t)^l[t], t=1..nops(l)), l]
          elif i=0 then
          else b(n-i, i, [l[], i]), b(n, i-1, l)
            fi
      end;
      ll:= NULL; b(n,n,[]);
      map(h-> h[2][], sort([ll], (x,y)-> x[1]
    				
  • Mathematica
    f[P_] := Times @@ (Prime[Range[Length[P]]]^P);
    row[n_] := SortBy[IntegerPartitions[n], f];
    Array[row, 7] // Flatten (* Jean-François Alcover, Feb 16 2021 *)

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}]

A181087 Partitions of n in the order of increasing smallest numbers of prime signatures.

Original entry on oeis.org

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

Views

Author

Alois P. Heinz, Jan 23 2011

Keywords

Comments

The parts of each partition are listed in increasing order.

Examples

			Smallest number with prime signature [1,1,1] is 2^1*3^1*5^1 = 30, the smallest number for [4] is 2^4 = 16, and thus [4] < [1,1,1] in this order.
First partitions in the order of increasing smallest numbers of prime signatures are: [1], [2], [1,1], [3], [1,2], [4], [1,3], [1,1,1], [5], [2,2], [1,4], [1,1,2], [6], [2,3], [1,5], [1,1,3], [7], [2,4], ...
Smallest numbers with these prime signatures are:  2, 4, 6, 8, 12, 16, 24, 30, 32, 36, 48, 60, 64, 72, 96, 120, 128, 144, ... A025487
		

Crossrefs

Programs

  • Mathematica
    DeleteDuplicates[Map[Sort[Map[Last, FactorInteger[#]]] &, Range[1000]]] // Grid (* Geoffrey Critzer, Nov 27 2015 *)
  • Sage
    def A181087_build(w):
        seen = set()
        a = []
        for n in PositiveIntegers():
            psig = tuple(sorted(m for p,m in factor(n)))
            if psig not in seen:
                a.extend(psig)
                seen.add(psig)
                if len(a) >= w: return a  # D. S. McNeil, Jan 23 2011

A344091 Flattened tetrangle of all finite multisets of positive integers sorted first by sum, then by length, then colexicographically.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 12 2021

Keywords

Comments

First differs from A334302 for partitions of 9.
The zeroth row contains only the empty partition.
A tetrangle is a sequence of finite triangles.

Examples

			Tetrangle begins:
  0: ()
  1: (1)
  2: (2)(11)
  3: (3)(12)(111)
  4: (4)(22)(13)(112)(1111)
  5: (5)(23)(14)(122)(113)(1112)(11111)
  6: (6)(33)(24)(15)(222)(123)(114)(1122)(1113)(11112)(111111)
		

Crossrefs

The version for lex instead of colex is A036036.
Starting with reversed partitions gives A036037.
Ignoring length gives A211992 (reversed: A080576).
Same as A334301 with partitions reversed.
The version for revlex instead of colex is A334302.
The Heinz numbers of these partitions are A334433.
The strict case is A344089.
A026791 reads off lexicographically ordered reversed partitions.
A080577 reads off reverse-lexicographically ordered partitions.
A112798 reads off reversed partitions by Heinz number.
A193073 reads off lexicographically ordered partitions.
A296150 reads off partitions by Heinz number.

Programs

  • Mathematica
    Table[Reverse/@Sort[IntegerPartitions[n]],{n,0,9}]

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.

A182937 Triangle in which n-th row lists all integer partitions of n, in order of traversing the periphery of the Fenner-Loizou tree in the clockwise sense.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Jan 21 2011

Keywords

Comments

If the Fenner-Loizou tree is traversed in the counterclockwise sense (preorder traversal) the integer partitions are in lexicographic order.

Examples

			First five rows are:
[[1]]
[[1, 1], [2]]
[[1, 1, 1], [2, 1], [3]]
[[1, 1, 1, 1], [2, 1, 1], [3, 1], [4], [2, 2]]
[[1, 1, 1, 1, 1], [2, 1, 1, 1], [3, 1, 1], [4, 1], [5], [3, 2], [2, 2,1]]
		

References

  • T. I. Fenner and G. Loizou, Comp. J. 23 (1980), 332-337.
  • D. E. Knuth, TAOCP 4 (2005), fasc. 3, 7.2.1.4, exercise 10.

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 A193073 for the graded lexicographic ordering.
See A228100 for the Fenner-Loizou (binary tree) ordering.

A214609 Table of numbers of distinct bracelets (reversible necklaces) with n beads corresponding to one partition P of n. Each part p of P corresponds to p beads of a distinct color.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 2, 2, 1, 1, 12, 6, 4, 2, 2, 1, 1, 60, 30, 16, 11, 10, 6, 3, 3, 3, 1, 1, 360, 180, 90, 48, 60, 30, 18, 10, 15, 9, 4, 3, 3, 1, 1, 2520, 1260, 630, 318, 171, 420, 210, 108, 70, 38, 105, 54, 33, 19, 8, 21, 12, 5, 4, 4, 1, 1, 20160, 10080, 5040, 2520, 1272, 3360, 1680, 840, 432, 560, 280, 94, 840, 420, 216, 140, 76, 38, 168, 84, 48, 28, 10, 28, 16, 7, 4, 4, 1, 1
Offset: 1

Views

Author

Washington Bomfim, Jul 22 2012

Keywords

Examples

			Table begins
   1
   1,1
   1,1,1
   3,2,2,1,1
  12,6,4,2,2,1,1
   ...
Line number 4 is 3,2,2,1,1 because three bracelets, (0 1 2 3), (0 1 3 2), and (0 2 1 3) correspond to partition [1 1 1 1]. (The colors are denoted by 0,1,2, and 3.) Bracelets (0 0 1 2), and (0 1 0 2) which have two beads of color 0, one of color 1, and one of color 2, correspond to [2 1 1]. (0 0 1 1), and (0 1 0 1) => [2 2]; (0 0 0 1) => [3 1], and (0 0 0 0) => [4].
From _Marko Riedel_, Jan 23 2025 (Start)
The ordering of the partitions used here is graded reflected lexicographic illustrated below with n=5:
  1,1,1,1,1 => 12
  1,1,1,2 => 6
  1,2,2 => 4
  1,1,3 => 2
  2,3 => 2
  1,4 => 1
  5 => 1 (End)
		

Crossrefs

Cf. A000041 (row lengths), A213939 (another version with partitions found in a different order), A005654, A005656, A141783, A000010, A380401.
Row sums give A213943.
Cf. A080576 (graded reflected lexicographic order).

Programs

  • PARI
    N; L = 0; max_n = 25;
    x = vector(max_n+1); P = vector(max_n+1);          \\ P - partition of n
    gcdP(t) = {if(t == 2, return(P[2])); GCD = gcd(P[2], P[3]);
    for(J = 4, t, GCD = gcd(GCD, P[J])); return(GCD) }
    x_P_div_d(t, d) = for(J = 2, t, x[J] = P[J]/d);
    F(a, t)= { b = x[2]!; for(J = 3, t, b *= x[J]!); return(a!/b) }
    Sum(t) = { S = 0; GCD = gcdP(t);
    fordiv(GCD, d, x_P_div_d(t,d); S+= eulerphi(d) * F(N/d, t)); return(S) }
    OneOdd(t) = {K = 0; for(J = 2, t, if(P[J] % 2 == 1, K++)); return(K==1)}
    TwoOdd(t) = {K = 0; for(J = 2, t, if(P[J] % 2 == 1, K++)); return(K==2)}
    x_floor_P_div_2(t) = for(J = 2, t, x[J] = floor(P[J]/2));
    all_even_parts(t) = { for(J = 2, t, if(P[J] % 2 == 1, return(0) ) ); return(1) }
    x_P_div_2(t) = for(J = 2, t, x[J] = P[J]/2);
    \\
    A(t) = {S = Sum(t); L++;
    if((N%2==1) && OneOdd(t), x_floor_P_div_2(t);
       print(L," ",(S + N * F((N-1)/2, t))/(2*N)); return() );
    if(N%2==1, print(L," ", S/(2*N)); return() );
    if(all_even_parts(t), x_P_div_2(t);
       print(L," ",(S + N * F(N/2, t))/(2*N)); return() );
    if((N%2==0) &&  TwoOdd(t), x_floor_P_div_2(t);
       print(L," ",(S + N * F((N-2)/2, t))/(2*N)); return() );
    print(L," ", S/(2*N)) }
                                                \\ F. Ruskey algorithm 4.24
    Part(n, k, t) = { P[t] = k;
    if(n == k, A(t), for(j = 1, min(k, n-k), Part(n-k, j, t+1) ) )}
    for(n = 1, max_n, N = n; Part(2*n, n, 1) );  \\ b-file format

Formula

With S = Sum_( d | GCD of the parts of P ) { phi(d) * F(n/d, P/d) },
| (S+n*F((n-1)/2, [P/2]))/(2*n) if odd n, and only 1 odd part in P,
| S/(2*n) if odd n, and other P,
| (S + n * F(n/2, P/2)) / (2*n) if P has all even parts,
a(n)=| (S + n * F((n-2)/2, [P/2])) / (2*n)
| if even n, and P has exactly two odd parts,
| S/(2*n) if even n, and other P.
Where P is a partition of n, P/d is a vector of all the parts of P divided by d. Each element of vector [P/2] is equal to floor(p/2), p one part of P, and F(x,Y) = x! / (Y_1! * Y_2! * ...).

A380401 Triangle read by rows: T(n,k) is the number of necklace permutations of a multiset whose multiplicities are given by the k-th partition of n in graded reflected lexicographic order.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 6, 3, 2, 1, 1, 24, 12, 6, 4, 2, 1, 1, 120, 60, 30, 16, 20, 10, 4, 5, 3, 1, 1, 720, 360, 180, 90, 120, 60, 30, 20, 30, 15, 5, 6, 3, 1, 1, 5040, 2520, 1260, 630, 318, 840, 420, 210, 140, 70, 210, 105, 54, 35, 10, 42, 21, 7, 7, 4, 1, 1, 40320, 20160, 10080, 5040, 2520, 6720, 3360, 1680, 840, 1120, 560, 188, 1680, 840, 420, 280, 140, 70, 336, 168, 84, 56, 14, 56, 28, 10, 8, 4, 1, 1
Offset: 1

Views

Author

Marko Riedel, Jan 23 2025

Keywords

Comments

See A318810 for a definition of necklace permutation.

Examples

			The ordering of the partitions used here is graded reflected lexicographic illustrated below with n=5:
  1,1,1,1,1 => 24
  1,1,1,2 => 12
  1,2,2 => 6
  1,1,3 => 4
  2,3 => 2
  1,4 => 1
  5 => 1
Table begins:
  1
  1,1
  2,1,1
  6,3,2,1,1
  24,12,6,4,2,1,1
		

References

  • F. Harary and E. Palmer, Graphical Enumeration, Academic Press, 1973, pages 36-37, 42-43.

Crossrefs

Cf. A000041 (row lengths), A072605 (row sums), A080576 (graded reflected lexicographic order), A212359 (similar triangle for Abramowitz-Stegun order), A318810, A334434, A214609 (up to rotations and reflections).

Programs

  • PARI
    C(sig)={my(n=vecsum(sig)); sumdiv(gcd(sig), d, eulerphi(d)*(n/d)!/prod(i=1, #sig, (sig[i]/d)!))/n}
    Row(n)={apply(C, vecsort([Vecrev(p) | p<-partitions(n)]))} \\ Andrew Howroyd, Jan 23 2025

Formula

For a distribution of colors n1+n2+...+nm = n the number of necklaces is (1/n)*Sum_{d|gcd(n1,n2,...,nm)} phi(d) (n/d)!/Prod_{q=1..m} (nq/d)!
T(n,k) = A318810(A334434(n,k)).
Previous Showing 21-30 of 32 results. Next