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

A281013 Tetrangle T(n,k,i) = i-th part of k-th prime composition of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jan 12 2017

Keywords

Comments

The *-product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling them together. Every finite positive integer sequence has a unique *-factorization using prime compositions P = {(1), (2), (21), (3), (211), ...}. See A060223 and A228369 for details.
These are co-Lyndon compositions, ordered first by sum and then lexicographically. - Gus Wiseman, Nov 15 2019

Examples

			The prime factorization of (1, 1, 4, 2, 3, 1, 5, 5) is: (11423155) = (1)*(1)*(5)*(5)*(4231). The prime factorizations of the initial terms of A000002 are:
             (1) = (1)
            (12) = (1)*(2)
           (122) = (1)*(2)*(2)
          (1221) = (1)*(221)
         (12211) = (1)*(2211)
        (122112) = (1)*(2)*(2211)
       (1221121) = (1)*(221121)
      (12211212) = (1)*(2)*(221121)
     (122112122) = (1)*(2)*(2)*(221121)
    (1221121221) = (1)*(221)*(221121)
   (12211212212) = (1)*(2)*(221)*(221121)
  (122112122122) = (1)*(2)*(2)*(221)*(221121).
Read as a sequence:
(1), (2), (21), (3), (211), (31), (4), (2111), (221), (311), (32), (41), (5).
Read as a triangle:
(1)
(2)
(21), (3)
(211), (31), (4)
(2111), (221), (311), (32), (41), (5).
Read as a sequence of triangles:
1    2    2 1    2 1 1    2 1 1 1    2 1 1 1 1    2 1 1 1 1 1
          3      3 1      2 2 1      2 2 1 1      2 1 2 1 1
                 4        3 1 1      3 1 1 1      2 2 1 1 1
                          3 2        3 1 2        2 2 2 1
                          4 1        3 2 1        3 1 1 1 1
                          5          4 1 1        3 1 1 2
                                     4 2          3 1 2 1
                                     5 1          3 2 1 1
                                     6            3 2 2
                                                  3 3 1
                                                  4 1 1 1
                                                  4 1 2
                                                  4 2 1
                                                  4 3
                                                  5 1 1
                                                  5 2
                                                  6 1
                                                  7.
		

Crossrefs

The binary version is A329318.
The binary non-"co" version is A102659.
A sequence listing all Lyndon compositions is A294859.
Numbers whose binary expansion is co-Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Binary Lyndon words are A001037.
Lyndon compositions are A059966.
Normal Lyndon words are A060223.

Programs

  • Mathematica
    colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    lexsort[f_,c_]:=OrderedQ[PadRight[{f,c}]];
    Table[Sort[Select[Join@@Permutations/@IntegerPartitions[n],colynQ],lexsort],{n,5}] (* Gus Wiseman, Nov 15 2019 *)

Formula

Row lengths are A059966(n) = number of prime compositions of n.

A318810 Number of necklace permutations of a multiset whose multiplicities are the prime indices of n > 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 2, 6, 1, 6, 1, 4, 3, 1, 1, 12, 4, 1, 16, 5, 1, 10, 1, 24, 3, 1, 5, 30, 1, 1, 4, 20, 1, 15, 1, 6, 30, 1, 1, 60, 10, 20, 4, 7, 1, 90, 7, 30, 5, 1, 1, 60, 1, 1, 54, 120, 10, 21, 1, 8, 5, 35, 1, 180, 1, 1, 70, 9, 14, 28, 1
Offset: 1

Views

Author

Gus Wiseman, Sep 04 2018

Keywords

Comments

This multiset is generally not the same as the multiset of prime indices of n. For example, the prime indices of 12 are {1,1,2}, while a multiset whose multiplicities are {1,1,2} is {1,1,2,3}.
A necklace is a finite sequence that is minimal among its cyclic permutations.
a(1) = 1 by convention.

Examples

			The a(21) = 3 necklace permutations of {1,1,1,1,2,2} are: (111122), (111212), (112112). Only the first two are Lyndon words, the third being periodic.
		

Crossrefs

Programs

  • Mathematica
    nrmptn[n_]:=Join@@MapIndexed[Table[#2[[1]],{#1}]&,If[n==1,{},Flatten[Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Permutations[nrmptn[n]],neckQ]],{n,2,100}]
  • PARI
    sig(n)={my(f=factor(n)); concat(vector(#f~, i, vector(f[i,2], j, primepi(f[i,1]))))}
    count(sig)={my(n=vecsum(sig)); sumdiv(gcd(sig), d, eulerphi(d)*(n/d)!/prod(i=1, #sig, (sig[i]/d)!))/n}
    a(n)={if(n==1, 1, count(sig(n)))} \\ Andrew Howroyd, Dec 08 2018

Formula

a(p) = 1 for prime p. - Andrew Howroyd, Dec 08 2018

Extensions

a(1) inserted by Andrew Howroyd, Dec 08 2018

A318808 Number of Lyndon permutations of a multiset whose multiplicities are the prime indices of n > 1.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 0, 2, 1, 1, 0, 3, 0, 1, 2, 6, 0, 6, 0, 4, 2, 1, 0, 12, 3, 1, 14, 5, 0, 10, 0, 24, 3, 1, 5, 30, 0, 1, 3, 20, 0, 15, 0, 6, 30, 1, 0, 60, 8, 20, 4, 7, 0, 90, 7, 30, 4, 1, 0, 60, 0, 1, 51, 120, 9, 21, 0, 8, 5, 35, 0, 180, 0, 1, 70, 9, 14, 28, 0, 120
Offset: 1

Views

Author

Gus Wiseman, Sep 04 2018

Keywords

Comments

This multiset is generally not the same as the multiset of prime indices of n. For example, the prime indices of 12 are {1,1,2}, while a multiset whose multiplicities are {1,1,2} is {1,1,2,3}.
The Lyndon product of two or more finite sequences is defined to be the lexicographically maximal sequence obtainable by shuffling the sequences together. For example, the Lyndon product of (231) with (213) is (232131), the product of (221) with (213) is (222131), and the product of (122) with (2121) is (2122121). A Lyndon word is a finite sequence that is prime with respect to the Lyndon product.
a(1) = 1 by convention.

Examples

			The a(30) = 10 Lyndon permutations of {1,1,1,2,2,3}:
  (111223)
  (111232)
  (111322)
  (112123)
  (112132)
  (112213)
  (112312)
  (113122)
  (113212)
  (121213)
		

Crossrefs

Programs

  • Mathematica
    nrmptn[n_]:=Join@@MapIndexed[Table[#2[[1]],{#1}]&,If[n==1,{},Flatten[Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    LyndonQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And]&&Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    Table[Length[Select[Permutations[nrmptn[n]],LyndonQ]],{n,2,100}]
  • PARI
    sig(n)={my(f=factor(n)); concat(vector(#f~, i, vector(f[i,2], j, primepi(f[i,1]))))}
    count(sig)={my(n=vecsum(sig)); sumdiv(gcd(sig), d, moebius(d)*(n/d)!/prod(i=1, #sig, (sig[i]/d)!))/n}
    a(n)={if(n==1, 1, count(sig(n)))} \\ Andrew Howroyd, Dec 08 2018

Formula

a(p) = 0 for prime p. - Andrew Howroyd, Dec 08 2018

A339677 Partition array: T(n, k) is the number of aperiodic necklaces (Lyndon words) on a multiset of colored beads (of size n) whose color multiplicities form the k-th partition of n in Abramowitz-Stegun order.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 1, 3, 6, 0, 1, 2, 4, 6, 12, 24, 0, 1, 2, 3, 5, 10, 14, 20, 30, 60, 120, 0, 1, 3, 5, 6, 15, 20, 30, 30, 60, 90, 120, 180, 360, 720, 0, 1, 3, 7, 8, 7, 21, 35, 51, 70, 42, 105, 140, 210, 312, 210, 420, 630, 840, 1260, 2520, 5040, 0, 1, 4, 9, 14, 8, 28, 56, 70, 84, 140
Offset: 1

Views

Author

Álvar Ibeas, Dec 12 2020

Keywords

Comments

As in A212359, A072605, and A261600, for each partition, the base set of beads is fixed.
Abuse of notation: we write T(n, L) for T(n, k), where L is the k-th partition of n in A-St order. We do accordingly for A036038 and A212359.

Examples

			Array begins:
  k:  1 2 3 4 5  6  7  8  9 10  11  12  13  14  15
      --------------------------------------------
n=1:  1
n=2:  0 1
n=3:  0 1 2
n=4:  0 1 1 3 6
n=5:  0 1 2 4 6 12 24
n=6:  0 1 2 3 5 10 14 20 30 60 120
n=7:  0 1 3 5 6 15 20 30 30 60  90 120 180 360 720
Consider partition L = (4, 2). There are 3 = A212359(6, L) necklaces on the bead set {a^4, b^2}: (aaaabb), (aaabab), and (aabaab). The latter has a period smaller than its size (3 < 6), whereas the other two are aperiodic. Hence, T(6, L) = 2.
T(n, (1,...,1)) = A212359(n, (1,...,1)) = (n-1)!, counting necklaces with n beads, each in a different color.
		

Crossrefs

Programs

  • PARI
    C(sig)={my(n=vecsum(sig)); sumdiv(gcd(sig), d, moebius(d)*(n/d)!/prod(i=1, #sig, (sig[i]/d)!))/n}
    Row(n)=[C(Vec(p)) | p<-partitions(n)]
    for(n=1, 7, print(Row(n))) \\ Andrew Howroyd, Dec 14 2020

Formula

Let L be a partition of n and d be the gcd of its parts. Then,
T(n, L) = n^(-1) * Sum_{v|d} mu(v) * A036038(n/v, L/v), where L/v is the partition obtained from L after dividing each part by v.
T(n, L) = Sum_{v|d} mu(v) * A212359(n/v, L/v).
T(n, L) = n^(-1) * A036038(n, L) - Sum_{1
T(n,k) = A298941(A036035(n,k)) = A318808(A185974(n,k)). - Andrew Howroyd, Dec 14 2020

A298947 Number of integer partitions y of n such that exactly one permutation of y is a Lyndon word.

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 11, 12, 15, 19, 22, 22, 29, 32, 32, 38, 42, 44, 49, 51, 54, 63, 63, 64, 71, 79, 76, 84, 87, 90, 96, 101, 101, 113, 108, 115, 122, 131, 125, 134, 138, 144, 147, 155, 150, 169, 163, 168, 173, 185, 180, 194, 191, 200, 198, 211, 209, 227, 218, 224, 231, 246
Offset: 1

Author

Gus Wiseman, Jan 30 2018

Keywords

Examples

			The a(6) = 7 partitions are (6), (51), (42), (411), (3111), (2211), (21111). This list does not include (321) because there are two possible permutations that are Lyndon words, namely (123) and (132). The list does not include (33), (222), or (111111) because no permutation of these is a Lyndon word.
		

Programs

  • Maple
    with(combinat): with(numtheory):
    g:= l-> (n-> `if`(n=0, 1, add(mobius(j)*multinomial(n/j,
            (l/j)[]), j=divisors(igcd(l[])))/n))(add(i, i=l)):
    b:= (n, i, l)-> `if`(n=0 or i=1, `if`(g([l[], n])=1, 1, 0),
                     add(b(n-i*j, i-1, [l[], j]), j=0..n/i)):
    a:= n-> b(n$2, []):
    seq(a(n), n=1..30);  # Alois P. Heinz, Feb 09 2018
  • Mathematica
    LyndonQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And]&&Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    Table[Length[Select[IntegerPartitions[n],Length[Select[Permutations[#],LyndonQ]]===1&]],{n,20}]
    (* Second program: *)
    multinomial[n_, k_List] := n!/Times @@ (k!);
    g[l_List] := With[{n = Total[l]}, If[n == 0, 1, Sum[MoebiusMu[j]*multinomial[n/j, l/j], {j, Divisors[GCD @@ l]}]/n]];
    b[n_, i_, l_List] := If[n == 0 || i == 1, If[g[Append[l, n]] == 1, 1, 0], Sum[b[n - i*j, i - 1, Append[l, j]], {j, 0, n/i}]];
    a[n_] := b[n, n, {}];
    Array[a, 30] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)

Extensions

a(23)-a(62) from Alois P. Heinz, Feb 09 2018

A318809 Number of necklace permutations of the multiset of prime indices of n > 1.

Original entry on oeis.org

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

Author

Gus Wiseman, Sep 04 2018

Keywords

Comments

A necklace is a finite sequence that is minimal among its cyclic permutations.
a(1) = 1 by convention.

Examples

			The a(144) = 3 necklace permutations of {1,1,1,1,2,2} are: (111122), (111212), (112112).
		

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Permutations[primeMS[n]],neckQ]],{n,2,200}]
Showing 1-6 of 6 results.