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.

A323858 Number of toroidal necklaces of positive integers summing to n.

Original entry on oeis.org

1, 1, 3, 5, 10, 14, 31, 44, 90, 154, 296, 524, 1035, 1881, 3636, 6869, 13208, 25150, 48585, 93188, 180192, 347617, 673201, 1303259, 2529740, 4910708, 9549665, 18579828, 36192118, 70540863, 137620889, 268655549, 524873503, 1026068477, 2007178821, 3928564237
Offset: 0

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

The 1-dimensional (necklace) case is A008965.
We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. Alternatively, a toroidal necklace is a matrix that is minimal among all possible rotations of its sequence of rows and its sequence of columns.

Examples

			Inequivalent representatives of the a(6) = 31 toroidal necklaces:
  6  15  24  33  114  123  132  222  1113  1122  1212  11112  111111
.
  1  2  3  11  11  12  12  111
  5  4  3  13  22  12  21  111
.
  1  1  1  2  11
  1  2  3  2  11
  4  3  2  2  11
.
  1  1  1
  1  1  2
  1  2  1
  3  2  2
.
  1
  1
  1
  1
  2
.
  1
  1
  1
  1
  1
  1
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    ptnmats[n_]:=Union@@Permutations/@Select[Union@@(Tuples[Permutations/@#]&/@Map[primeMS,facs[n],{2}]),SameQ@@Length/@#&];
    neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}]];
    Table[Length[Join@@Table[Select[ptnmats[k],neckmatQ],{k,Times@@Prime/@#&/@IntegerPartitions[n]}]],{n,10}]
  • PARI
    U(n,m,k) = (1/(n*m)) * sumdiv(n, c, sumdiv(m, d, eulerphi(c) * eulerphi(d) * subst(k, x, x^lcm(c,d))^(n*m/lcm(c, d))));
    a(n)={if(n < 1, n==0, sum(i=1, n, sum(j=1, n\i, polcoef(U(i, j, x/(1-x) + O(x*x^n)), n))))} \\ Andrew Howroyd, Aug 18 2019

Extensions

Terms a(18) and beyond from Andrew Howroyd, Aug 18 2019

A323861 Table read by antidiagonals where A(n,k) is the number of n X k aperiodic binary toroidal necklaces.

Original entry on oeis.org

2, 1, 1, 2, 2, 2, 3, 9, 9, 3, 6, 27, 54, 27, 6, 9, 99, 335, 335, 99, 9, 18, 326, 2182, 4050, 2182, 326, 18, 30, 1161, 14523, 52377, 52377, 14523, 1161, 30, 56, 4050, 99858, 698535, 1342170, 698535, 99858, 4050, 56, 99, 14532, 698870, 9586395, 35790267, 35790267, 9586395, 698870, 14532, 99
Offset: 1

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

The 1-dimensional (Lyndon word) case is A001037.
We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. An n X k matrix is aperiodic if all n * k rotations of its sequence of rows and its sequence of columns are distinct.

Examples

			Table begins:
        1    2    3    4
    ------------------------
  1: |  2    1    2    3
  2: |  1    2    9   27
  3: |  2    9   54  335
  4: |  3   27  335 4050
Inequivalent representatives of the A(3,2) = 9 aperiodic toroidal necklaces:
  [0 0 0] [0 0 0] [0 0 1] [0 0 1] [0 0 1] [0 0 1] [0 0 1] [0 1 1] [0 1 1]
  [0 0 1] [0 1 1] [0 1 0] [0 1 1] [1 0 1] [1 1 0] [1 1 1] [1 0 1] [1 1 1]
		

Crossrefs

First and last columns are A001037. Main diagonal is A323872.

Programs

  • GAP
    # See link for code.
    for n in [1..8] do for k in [1..8] do Print(A323861(n,k), ", "); od; Print("\n"); od; # Andrew Howroyd, Aug 21 2019
  • Mathematica
    apermatQ[m_]:=UnsameQ@@Join@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}];
    neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}]];
    Table[Length[Select[Partition[#,n-k]&/@Tuples[{0,1},(n-k)*k],And[apermatQ[#],neckmatQ[#]]&]],{n,6},{k,n-1}]

Extensions

Terms a(37) and beyond from Andrew Howroyd, Aug 21 2019

A323870 Number of toroidal necklaces of size n whose entries cover an initial interval of positive integers.

Original entry on oeis.org

1, 4, 10, 61, 218, 3136, 13514, 272998, 2362439, 40899248, 295024106, 14045787790, 81055130522, 3040383719360, 61408850927732, 1661142088494553, 15337737297545402, 1128511554421317128, 9768588138876674858, 803306338873366385030, 15452347618762680757428
Offset: 1

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. Alternatively, a toroidal necklace is a matrix that is minimal among all possible rotations of its sequence of rows and its sequence of columns.

Examples

			The a(3) = 10 toroidal necklaces:
  [1 2 3] [1 3 2] [1 2 2] [1 1 2] [1 1 1]
.
  [1] [1] [1] [1] [1]
  [2] [3] [2] [1] [1]
  [3] [2] [2] [2] [1]
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    nrmmats[n_]:=Join@@Table[Table[Table[Position[stn,{i,j}][[1,1]],{i,d},{j,n/d}],{stn,Join@@Permutations/@sps[Tuples[{Range[d],Range[n/d]}]]}],{d,Divisors[n]}];
    neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}]];
    Table[Length[Select[nrmmats[n],neckmatQ]],{n,6}]
  • PARI
    U(n,m,k) = (1/(n*m)) * sumdiv(n, c, sumdiv(m, d, eulerphi(c) * eulerphi(d) * k^(n*m/lcm(c, d))));
    R(v)={sum(n=1, #v, sum(k=1, n, (-1)^(n-k)*binomial(n,k)*v[k]))}
    a(n)={if(n < 1, n==0, R(vector(n, k, sumdiv(n, d, U(d, n/d, k))) ))} \\ Andrew Howroyd, Aug 18 2019

Extensions

Terms a(9) and beyond from Andrew Howroyd, Aug 18 2019

A323867 Number of aperiodic arrays of positive integers summing to n.

Original entry on oeis.org

1, 1, 1, 5, 11, 33, 57, 157, 303, 683, 1358, 2974, 5932, 12560, 25328, 52400, 106256, 217875, 441278, 899955, 1822703, 3701401, 7491173, 15178253, 30691135, 62085846, 125435689, 253414326, 511547323, 1032427635, 2082551931, 4199956099, 8466869525, 17064777665
Offset: 0

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

The 1-dimensional case is A000740.
An n X k matrix is aperiodic if all n * k rotations of its sequence of rows and its sequence of columns are distinct.

Examples

			The a(5) = 33 arrays:
  5  14  23  32  41  113  122  131  212  221  311  1112  1121  1211  2111
.
  1  2  3  4  11  11  12  21
  4  3  2  1  12  21  11  11
.
  1  1  1  2  2  3
  1  2  3  1  2  1
  3  2  1  2  1  1
.
  1  1  1  2
  1  1  2  1
  1  2  1  1
  2  1  1  1
		

Crossrefs

Programs

  • GAP
    List([0..30], A323867); # See A323861 for code; Andrew Howroyd, Aug 21 2019
  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    ptnmats[n_]:=Union@@Permutations/@Select[Union@@(Tuples[Permutations/@#]&/@Map[primeMS,facs[n],{2}]),SameQ@@Length/@#&];
    apermatQ[m_]:=UnsameQ@@Join@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}];
    Table[Length[Union@@Table[Select[ptnmats[k],apermatQ],{k,Times@@Prime/@#&/@IntegerPartitions[n]}]],{n,15}]

Extensions

Terms a(16) and beyond from Andrew Howroyd, Aug 21 2019

A323871 Number of aperiodic toroidal necklaces of size n whose entries cover an initial interval of positive integers.

Original entry on oeis.org

1, 2, 8, 53, 216, 3112, 13512, 272844, 2362412, 40898808, 295024104, 14045779864, 81055130520, 3040383692328, 61408850927280, 1661142087743940, 15337737297545400, 1128511554416582908, 9768588138876674856, 803306338873264137240, 15452347618762680730384
Offset: 1

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

The 1-dimensional (Lyndon word) case is A060223.
We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. An n X k matrix is aperiodic if all n * k rotations of its sequence of rows and its sequence of columns are distinct.

Examples

			The a(3) = 8 aperiodic toroidal necklaces:
  [1 2 3] [1 3 2] [1 2 2] [1 1 2]
.
  [1] [1] [1] [1]
  [2] [3] [2] [1]
  [3] [2] [2] [2]
		

Crossrefs

Programs

  • GAP
    List([1..30], A323871); # See A323861 for code; Andrew Howroyd, Aug 21 2019
  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    nrmmats[n_]:=Join@@Table[Table[Table[Position[stn,{i,j}][[1,1]],{i,d},{j,n/d}],{stn,Join@@Permutations/@sps[Tuples[{Range[d],Range[n/d]}]]}],{d,Divisors[n]}];
    apermatQ[m_]:=UnsameQ@@Join@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}];
    neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}]];
    Table[Length[Select[nrmmats[n],neckmatQ[#]&&apermatQ[#]&]],{n,6}]

Extensions

Terms a(9) and beyond from Andrew Howroyd, Aug 21 2019

A324513 Number of aperiodic cycle necklaces with n vertices.

Original entry on oeis.org

1, 0, 0, 0, 2, 7, 51, 300, 2238, 18028, 164945, 1662067, 18423138, 222380433, 2905942904, 40864642560, 615376173176, 9880203467184, 168483518571789, 3041127459127222, 57926238289894992, 1161157775616335125, 24434798429947993043, 538583682037962702384
Offset: 1

Views

Author

Gus Wiseman, Mar 04 2019

Keywords

Comments

We define an aperiodic cycle necklace to be an equivalence class of (labeled, undirected) Hamiltonian cycles under rotation of the vertices such that all n of these rotations are distinct.

Crossrefs

Cf. A000740, A000939, A001037 (binary Lyndon words), A008965, A059966 (Lyndon compositions), A060223 (normal Lyndon words), A061417, A064852 (if cycle is oriented), A086675, A192332, A275527, A323866 (aperiodic toroidal arrays), A323871.

Programs

  • Mathematica
    rotgra[g_,m_]:=Sort[Sort/@(g/.k_Integer:>If[k==m,1,k+1])];
    Table[Length[Select[Union[Sort[Sort/@Partition[#,2,1,1]]&/@Permutations[Range[n]]],#==First[Sort[Table[Nest[rotgra[#,n]&,#,j],{j,n}]]]&&UnsameQ@@Table[Nest[rotgra[#,n]&,#,j],{j,n}]&]],{n,8}]
  • PARI
    a(n)={if(n<3, n==0||n==1, (if(n%2, 0, -(n/2-1)!*2^(n/2-2)) + sumdiv(n, d, moebius(n/d)*eulerphi(n/d)*(n/d)^d*d!/n^2))/2)} \\ Andrew Howroyd, Aug 19 2019

Formula

a(n) = A324512(n)/n.
a(2*n+1) = A064852(2*n+1)/2 for n > 0; a(2*n) = (A064852(2*n) - A002866(n-1))/2 for n > 1. - Andrew Howroyd, Aug 16 2019

Extensions

Terms a(10) and beyond from Andrew Howroyd, Aug 19 2019

A306669 Number of aperiodic permutation necklaces of weight n.

Original entry on oeis.org

1, 0, 1, 4, 23, 110, 719, 4992, 40302, 362492, 3628799, 39912804, 479001599, 6226974714, 87178289207, 1307673722880, 20922789887999, 355687417744992, 6402373705727999, 121645100223036700, 2432902008176115023, 51090942167993548790, 1124000727777607679999
Offset: 1

Views

Author

Gus Wiseman, Mar 04 2019

Keywords

Comments

A permutation is aperiodic if every rotation of {1...n} acts on the vertices of the cycle decomposition to produce a different digraph. A permutation necklace is an equivalence class of permutations under the action of rotation of vertices in the cycle decomposition. The corresponding action on words applies m -> m + 1 for m < n and n -> 1, and rotates once to the right. For example, (24531) first becomes (35142) under the application of cyclic rotation, and then is rotated right to give (23514).

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Permutations[Range[n]],UnsameQ@@NestList[RotateRight[#/.k_Integer:>If[k==n,1,k+1]]&,#,n-1]&]]/n,{n,6}]
  • PARI
    a(n) = (1/n)*sumdiv(n, d, moebius(n/d)*(n/d)^d*d!); \\ Andrew Howroyd, Aug 19 2019

Formula

a(n) = A324514(n)/n.
a(n) = (1/n)*Sum_{d|n} mu(n/d)*(n/d)^d*d!. - Andrew Howroyd, Aug 19 2019

Extensions

Terms a(10) and beyond from Andrew Howroyd, Aug 19 2019

A323872 Number of n X n aperiodic binary toroidal necklaces.

Original entry on oeis.org

1, 2, 2, 54, 4050, 1342170, 1908852102, 11488774559598, 288230375950387200, 29850020237398244599296, 12676506002282260237970435130, 21970710674130840874443091905460038, 154866286100907105149455216472736043777350, 4427744605404865645682169434028029029963535277450
Offset: 0

Views

Author

Gus Wiseman, Feb 04 2019

Keywords

Comments

The 1-dimensional (Lyndon word) case is A001037.
We define a toroidal necklace to be an equivalence class of matrices under all possible rotations of the sequence of rows and the sequence of columns. An n X k matrix is aperiodic if all n * k rotations of its sequence of rows and its sequence of columns are distinct.

Examples

			Inequivalent representatives of the a(2) = 2 aperiodic necklaces:
  [0 0] [0 1]
  [0 1] [1 1]
Inequivalent representatives of the a(3) = 54 aperiodic necklaces:
  000  000  000  000  000  000  000  000  000
  000  000  001  001  001  001  001  001  001
  001  011  001  010  011  100  101  110  111
.
  000  000  000  000  000  000  000  000  000
  011  011  011  011  011  011  011  111  111
  001  010  011  100  101  110  111  001  011
.
  001  001  001  001  001  001  001  001  001
  001  001  001  001  001  001  010  010  010
  010  011  100  101  110  111  011  101  110
.
  001  001  001  001  001  001  001  001  001
  010  011  011  011  011  011  100  100  100
  111  010  011  101  110  111  011  110  111
.
  001  001  001  001  001  001  001  001  001
  101  101  101  101  110  110  110  110  111
  011  101  110  111  011  101  110  111  011
.
  001  001  001  011  011  011  011  011  011
  111  111  111  011  011  011  101  110  111
  101  110  111  101  110  111  111  111  111
		

Crossrefs

Programs

  • Mathematica
    apermatQ[m_]:=UnsameQ@@Join@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}];
    neckmatQ[m_]:=m==First[Union@@Table[RotateLeft[m,{i,j}],{i,Length[m]},{j,Length[First[m]]}]];
    Table[Length[Select[(Partition[#,n]&)/@Tuples[{0,1},n^2],And[apermatQ[#],neckmatQ[#]]&]],{n,4}]

Extensions

Terms a(5) and beyond from Andrew Howroyd, Aug 21 2019

A306715 Number of graphical necklaces with n vertices and distinct rotations.

Original entry on oeis.org

1, 0, 2, 12, 204, 5372, 299592, 33546240, 7635496960, 3518433853392, 3275345183542176, 6148914685509544960, 23248573454127484128960, 176848577040728399988915648, 2704321280486889389857342715776, 83076749736557240903566436660674560
Offset: 1

Views

Author

Gus Wiseman, Mar 05 2019

Keywords

Comments

A simple graph with n vertices has distinct rotations if all n rotations of its vertex set act on the edge set to give distinct graphs. A graphical necklace is a simple graph that is minimal among all n rotations of the vertices.

Crossrefs

Cf. A000088, A001037, A006125, A059966, A060223, A086675, A192332 (graphical necklaces), A306669, A323861, A323865, A323866, A323871, A324461 (distinct rotations), A324513.

Programs

  • Mathematica
    rotgra[g_,m_]:=Sort[Sort/@(g/.k_Integer:>If[k==m,1,k+1])];
    Table[Length[Select[Subsets[Subsets[Range[n],{2}]],With[{rots=Table[Nest[rotgra[#,n]&,#,j],{j,n}]},UnsameQ@@rots&&#==First[Sort[rots]]]&]],{n,5}]
  • PARI
    a(n)={if(n==0, 1, sumdiv(n, d, moebius(d)*2^(n*(n/d-1)/2 + n*(d\2)/d))/n)} \\ Andrew Howroyd, Aug 15 2019

Formula

a(n > 0) = A324461(n)/n.
a(n) = (1/n)*Sum_{d|n} mu(d)*2^(n*(n/d-1)/2 + n*floor(d/2)/d) for n > 0. - Andrew Howroyd, Aug 15 2019

Extensions

Terms a(7) and beyond from Andrew Howroyd, Aug 15 2019
Showing 1-9 of 9 results.