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-10 of 145 results. Next

A247003 Decimal expansion of a constant related to A034691.

Original entry on oeis.org

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

Views

Author

Vaclav Kotesovec, Sep 09 2014

Keywords

Examples

			1.397649005083650285065074598526791159007811429440728996483874...
		

Crossrefs

Programs

  • Maple
    evalf(exp(sum(1/(k*(2^k-2)), k=2..infinity)), 100)

Formula

Equals exp( Sum_{k>=2} 1/(k*(2^k-2)) ).

A302242 Total weight of the n-th multiset multisystem. Totally additive with a(prime(n)) = Omega(n).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 03 2018

Keywords

Comments

A multiset multisystem is a finite multiset of finite multisets of positive integers. The n-th multiset multisystem is constructed by factoring n into prime numbers and then factoring each prime index into prime numbers and taking their prime indices. This produces a unique multiset multisystem for each n, and every possible multiset multisystem is so constructed as n ranges over all positive integers.

Examples

			Sequence of finite multisets of finite multisets of positive integers begins: (), (()), ((1)), (()()), ((2)), (()(1)), ((11)), (()()()), ((1)(1)), (()(2)), ((3)), (()()(1)), ((12)), (()(11)), ((1)(2)), (()()()()), ((4)), (()(1)(1)), ((111)), (()()(2)).
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> add(add(j[2], j=ifactors(pi(i[1]))[2])*i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 07 2018
  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[PrimeOmega/@primeMS[n]],{n,100}]
  • PARI
    a(n,f=factor(n))=sum(i=1,#f~, bigomega(primepi(f[i,1]))*f[i,2]) \\ Charles R Greathouse IV, Nov 10 2021

A283877 Number of non-isomorphic set-systems of weight n.

Original entry on oeis.org

1, 1, 2, 4, 9, 18, 44, 98, 244, 605, 1595, 4273, 12048, 34790, 104480, 322954, 1031556, 3389413, 11464454, 39820812, 141962355, 518663683, 1940341269, 7424565391, 29033121685, 115921101414, 472219204088, 1961177127371, 8298334192288, 35751364047676, 156736154469354
Offset: 0

Views

Author

Gus Wiseman, Mar 17 2017

Keywords

Comments

A set-system is a finite set of finite nonempty sets. The weight of a set-system is the sum of cardinalities of its elements.

Examples

			Non-isomorphic representatives of the a(4)=9 set-systems are:
((1234)),
((1)(234)), ((3)(123)), ((12)(34)), ((13)(23)),
((1)(2)(12)), ((1)(2)(34)), ((1)(3)(23)),
((1)(2)(3)(4)).
		

Crossrefs

Programs

  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v, n, (-1)^(n-1)/n))))-1, -#v)}
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    K(q, t, k)={WeighT(Vec(sum(j=1, #q, my(g=gcd(t, q[j])); g*x^(q[j]/g)) + O(x*x^k), -k))}
    a(n)={if(n==0, 1, my(s=0); forpart(q=n, my(g=sum(t=1, n, subst(x*Ser(K(q, t, n\t)/t),x,x^t) )); s+=permcount(q)*polcoef(exp(g - subst(g,x,x^2)), n)); s/n!)} \\ Andrew Howroyd, Jan 16 2024

Formula

Euler transform of A300913.

Extensions

a(0) = 1 prepended and terms a(11) and beyond from Andrew Howroyd, Sep 01 2019

A049311 Number of (0,1) matrices with n ones and no zero rows or columns, up to row and column permutations.

Original entry on oeis.org

1, 3, 6, 16, 34, 90, 211, 558, 1430, 3908, 10725, 30825, 90156, 273234, 848355, 2714399, 8909057, 30042866, 103859678, 368075596, 1335537312, 4958599228, 18820993913, 72980867400, 288885080660, 1166541823566, 4802259167367, 20141650236664
Offset: 1

Views

Author

Keywords

Comments

Also the number of bipartite graphs with n edges, no isolated vertices and a distinguished bipartite block, up to isomorphism.
The EULERi transform (A056156) is also interesting.
a(n) is also the number of non-isomorphic set multipartitions (multisets of sets) of weight n. - Gus Wiseman, Mar 17 2017

Examples

			E.g. a(2) = 3: two ones in same row, two ones in same column, or neither.
a(3) = 6 is coefficient of x^3 in (1/36)*((1 + x)^9 + 6*(1 + x)^3*(1 + x^2)^3 + 8*(1 + x^3)^3 + 9*(1 + x)*(1 + x^2)^4 + 12*(1 + x^3)*(1 + x^6))=1 + x + 3*x^2 + 6*x^3 + 7*x^4 + 7*x^5 + 6*x^6 + 3*x^7 + x^8 + x^9.
There are a(3) = 6 binary matrices with 3 ones, with no zero rows or columns, up to row and column permutation:
  [1 0 0] [1 1 0] [1 0] [1 1] [1 1 1] [1]
  [0 1 0] [0 0 1] [1 0] [1 0] ....... [1].
  [0 0 1] ....... [0 1] ............. [1]
Non-isomorphic representatives of the a(3)=6 set multipartitions are: ((123)), ((1)(23)), ((2)(12)), ((1)(1)(1)), ((1)(2)(2)), ((1)(2)(3)). - _Gus Wiseman_, Mar 17 2017
		

Crossrefs

Programs

  • PARI
    WeighT(v)={Vec(exp(x*Ser(dirmul(v, vector(#v,n,(-1)^(n-1)/n))))-1,-#v)}
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    K(q, t, k)={WeighT(Vec(sum(j=1, #q, gcd(t, q[j])*x^lcm(t, q[j])) + O(x*x^k), -k))}
    a(n)={my(s=0); forpart(q=n, s+=permcount(q)*polcoef(exp(x*Ser(sum(t=1, n, K(q, t, n)/t))), n)); s/n!} \\ Andrew Howroyd, Jan 16 2023

Formula

Calculate number of connected bipartite graphs + number of connected bipartite graphs with no duality automorphism, then apply EULER transform.
a(n) is the coefficient of x^n in the cycle index Z(S_n X S_n; 1+x, 1+x^2, ...), where S_n X S_n is Cartesian product of symmetric groups S_n of degree n.

Extensions

More terms and formula from Vladeta Jovovic, Jul 29 2000
a(19)-a(28) from Max Alekseyev, Jul 22 2009
a(29)-a(102) from Aliaksandr Siarhei, Dec 13 2013
Name edited by Gus Wiseman, Dec 18 2018

A255906 Number of collections of nonempty multisets with a total of n objects having color set {1,...,k} for some k<=n.

Original entry on oeis.org

1, 1, 4, 16, 76, 400, 2356, 15200, 106644, 806320, 6526580, 56231024, 513207740, 4941362512, 50013751812, 530481210672, 5880285873060, 67954587978448, 816935340368068, 10196643652651664, 131904973822724540, 1765645473517011568, 24420203895517396180
Offset: 0

Views

Author

Alois P. Heinz, Mar 10 2015

Keywords

Comments

Number of multiset partitions of normal multisets of size n, where a multiset is normal if it spans an initial interval of positive integers. - Gus Wiseman, Jul 30 2018

Examples

			a(0) = 1: {}.
a(1) = 1: {{1}}.
a(2) = 4: {{1},{1}}, {{1,1}}, {{1},{2}}, {{1,2}}.
a(3) = 16: {{1},{1},{1}}, {{1},{1,1}}, {{1,1,1}}, {{1},{1},{2}}, {{1},{2},{2}}, {{1},{1,2}}, {{1},{2,2}}, {{2},{1,1}}, {{2},{1,2}}, {{1,1,2}}, {{1,2,2}}, {{1},{2},{3}}, {{1},{2,3}}, {{2},{1,3}}, {{3},{1,2}}, {{1,2,3}}.
		

Crossrefs

Row sums of A255903. Also row sums of A317532.

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    allnorm[n_]:=Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1];
    Table[Length[Join@@mps/@allnorm[n]],{n,6}] (* Gus Wiseman, Jul 30 2018 *)
  • PARI
    R(n, k)={Vec(-1 + 1/prod(j=1, n, (1 - x^j + O(x*x^n))^binomial(k+j-1, j) ))}
    seq(n) = {concat([1], sum(k=1, n, R(n, k)*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ))} \\ Andrew Howroyd, Sep 23 2023

Formula

a(n) = Sum_{k=0..n} A255903(n,k).

A269134 Number of combinatory separations of normal multisets of weight n.

Original entry on oeis.org

1, 4, 14, 57, 223, 948, 3940, 16994, 72964, 317959, 1385592, 6085763, 26738139, 117939291, 520553999, 2301781692, 10181786176, 45074744448, 199558036891, 883670342156, 3912320450786
Offset: 1

Views

Author

Gus Wiseman, Feb 20 2016

Keywords

Comments

A multiset is normal if it spans an initial interval of positive integers. The type of a multiset of integers is the unique normal multiset that has the same sequence of multiplicities when its entries are taken in increasing order. For example the type of 335556 is 112223.
If and only if there exists a multiset partition p whose multiset union has type h and where g = {g_1,...,g_n} is the multiset of types of the blocks of p, there exists a *combinatory separation* which is regarded as a multi-arrow p:h<=g. For example 1122<={12,11} is *not* a combinatory separation because one cannot partition a multiset of type 1122 into two blocks where one block has two distinct elements and the other block has two equal elements. Normal multisets N and combinatory separations S comprise a multi-order (N,S). The value of a(n) is the total number of *distinct* combinatory separations h<=g where h has weight n.
The term "combinatory separation" is inspired by MacMahon's inscrutable "Combinatory Analysis" (1915) which states: "A partition of any number is "separated" into "separates" by writing down a set [sic] of partitions, each partition in its own brackets, from left to right so that when all of the parts of these partitions are assembled in a single bracket, the partition separated is reproduced."

Examples

			For a(3) the 14 distinct combinatory separations grouped according to head are: 111<={111}, 111<={1,11}, 111<={1,1,1}; 112<={112}, 112<={1,11}, 112<={1,12}, 112<={1,1,1}; 122<={122}, 122<={1,11}, 122<={1,12}, 122<={1,1,1}; 123<={123}, 123<={1,12}, 123<={1,1,1}.
Note that in this enumeration the two multiset partitions {{1},{2,3}}:123<={1,12} and {{1,2},{3}}:123<={1,12} do not represent distinct multi-arrows and consequently are counted only once, whereas the two multiset partitions {{1},{1,2}}:112<={1,12} and {{1,2},{2}}:122<={1,12} are counted separately even though they have the same multiset of block-types.
		

Crossrefs

Cf. A255906 (multiset partitions of normal multisets of weight n), A096443 (multiset partitions of multiset class representatives), A007716 (non-isomorphic multiset partitions of weight n).

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    normize[m_]:=m/.Rule@@@Table[{Union[m][[i]],i},{i,Length[Union[m]]}];
    Table[Length[Union@@Table[{m,Sort[normize/@#]}&/@mps[m],{m,allnorm[n]}]],{n,7}] (* Gus Wiseman, Aug 29 2018 *)

Extensions

a(9) from Gus Wiseman, Aug 29 2018
a(10) from Robert Price, Sep 14 2018
a(11)-a(21) from Martin Fuller, Mar 22 2025

A335456 Number of normal patterns matched by compositions of n.

Original entry on oeis.org

1, 2, 5, 12, 32, 84, 211, 556, 1446, 3750, 9824, 25837, 67681, 178160, 468941, 1233837, 3248788, 8554709
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The 8 compositions of 4 together with the a(4) = 32 patterns they match:
  4:   31:   13:   22:   211:   121:   112:   1111:
-----------------------------------------------------
  ()   ()    ()    ()    ()     ()     ()     ()
  (1)  (1)   (1)   (1)   (1)    (1)    (1)    (1)
       (21)  (12)  (11)  (11)   (11)   (11)   (11)
                         (21)   (12)   (12)   (111)
                         (211)  (21)   (112)  (1111)
                                (121)
		

Crossrefs

References found in the link are not all included here.
The version for standard compositions is A335454.
The contiguous case is A335457.
The version for Heinz numbers of partitions is A335549.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A333257(n) distinct subsequence-sums.
The n-th composition has A334299(n) distinct subsequences.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Sum[Length[Union[mstype/@Subsets[y]]],{y,Join@@Permutations/@IntegerPartitions[n]}],{n,0,8}]

Extensions

a(14)-a(16) from Jinyuan Wang, Jun 26 2020
a(17) from John Tyler Rascoe, Mar 14 2025

A060223 Number of orbits of length n under the map whose periodic points are counted by A000670.

Original entry on oeis.org

1, 1, 1, 4, 18, 108, 778, 6756, 68220, 787472, 10224702, 147512052, 2340963570, 40527565260, 760095923082, 15352212731820, 332228417589720, 7668868648772700, 188085259069430744, 4884294069438337428, 133884389812214097774, 3863086904690670182596
Offset: 0

Views

Author

Thomas Ward, Mar 21 2001

Keywords

Comments

From Gus Wiseman, Oct 14 2016: (Start)
A finite sequence is normal if it spans an initial interval of positive integers. The *-product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, (2 2 1) * (2 1 3) = (2 1 2 2 1 3). If Q is the set of compositions (finite sequences of positive integers) then (Q,*) is an Abelian group freely generated by a set P of prime sequences. The number of normal prime sequences of length n is equal to a(n). See example 2 and Mathematica program 2.
If N is the species (endofunctor over the category of finite sets and permutations) of unlabeled necklaces and N(S) represents the set of all non-isomorphic primitive necklaces of length n=|S|, then the numbers |N(S)| are equal to the numbers a(|S|) for any finite set S. This is because the number of orderless *-factorizations (see A034691 and A269134) of any finite sequence q is equal to the number of multiset partitions (see A007716 and A255906) of the multiset of prime factors of q. (End)

Examples

			a(5) = 108 since A000670(5) is 541 and A000670(1) is 1, so there must be (541-1)/5 = 108 orbits of length 5.
From _Gus Wiseman_, Oct 14 2016: (Start)
The a(4) = 18 normal prime sequences are the columns:
[2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4]
[1 2 2 1 1 1 2 2 2 2 3 3 1 1 2 2 3 3]
[1 1 2 1 2 2 1 1 2 3 1 2 2 3 1 3 1 2]
[1 1 1 2 1 2 1 2 1 1 2 1 3 2 3 1 2 1].
The symmetric function A(x_1,x_2,x_3,...) expanded in terms of monomial symmetric functions m(y) (indexed by integer partitions y) is equal to:
A = m(1) +
    m(11) +
    (2*m(21) + 2*m(111) +
    (m(22) + 2*m(31) + 9*m(211) + 6*m(1111)) +
    (4*m(32) + 2*m(41) + 18*m(221) + 12*m(311) + 48*m(2111) + 24*m(11111)) +
    (3*m(33) + 4*m(42) + 2*m(51) + 14*m(222) + 60*m(321) + 15*m(411) + 180*m(2211) + 80*m(3111) + 300*m(21111) + 120*m(111111)) + ... (End)
		

Crossrefs

Cf. A000670, A034691 (multisets of compositions), A269134, A007716, A277427, A215474, A255906.
Row sums of A254040.

Programs

  • Mathematica
    a[n_] := DivisorSum[n, MoebiusMu[#] HurwitzLerchPhi[1/2, -n/#, 0]/2 &] / n; a[0] = 1; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Mar 30 2016 *)
    thufbin[{},b_List]:=b;thufbin[a_List,{}]:=a;thufbin[a_List]:=a;
    thufbin[{x_,a___},{y_,b___}]:=Switch[Ordering[If[x=!=y,{x,y},{thufbin[{a},{x,b}],thufbin[{x,a},{b}]}]],{1,2},Prepend[thufbin[{a},{y,b}],x],{2,1},Prepend[thufbin[{x,a},{b}],y]];
    thufbin[a_List,b_List,c__List]:=thufbin[a,thufbin[b,c]];
    priseqs[n_]:=Fold[Select,Tuples[Range[n],n],{Union[#]===Range[First[#]]&,Function[q,Select[Table[List[Take[q,{1,j}],Take[q,{j+1,n}]],{j,1,n-1}],thufbin@@Sort[#]===q&,1]==={}]}];
    Table[Length[priseqs[n]],{n,1,7}] (* Gus Wiseman, Oct 14 2016 *)
  • PARI
    \\ here b(n) is A000670
    b(n)={polcoeff(serlaplace(1/(2-exp(x+O(x*x^n)))), n)}
    a(n)={if(n<1, n==0, sumdiv(n, d, moebius(d)*b(n/d))/n)} \\ Andrew Howroyd, Dec 12 2017

Formula

a(n) = (1/n)* Sum_{d|n} mu(d)*A000670(n/d) for n > 0, where mu is A008683, the Moebius function. - Edited by Michel Marcus, Mar 30 2016
Let A = Sum_{q in P} Prod_i x_{q_i} = Sum_y c_y m(y) be the symmetric function whose coefficient of m(y) is equal to the number of permutations of the normal multiset [k]^y that belong to P, where the multiplicity of i in [k]^y is defined to be y_i. Then a(n) is the sum of c_y taken over all integer partitions of n. See example 3. - Gus Wiseman, Oct 14 2016
a(n) = Sum_{d|n} mu(d) * A019536(n/d) for n >= 1. - Petros Hadjicostas, Aug 19 2019

Extensions

More terms from Alois P. Heinz, Jan 23 2015

A317533 Regular triangle read rows: T(n,k) = number of non-isomorphic multiset partitions of size n and length k.

Original entry on oeis.org

1, 2, 2, 3, 4, 3, 5, 14, 9, 5, 7, 28, 33, 16, 7, 11, 69, 104, 74, 29, 11, 15, 134, 294, 263, 142, 47, 15, 22, 285, 801, 948, 599, 263, 77, 22, 30, 536, 2081, 3058, 2425, 1214, 453, 118, 30, 42, 1050, 5212, 9769, 9276, 5552, 2322, 761, 181, 42, 56, 1918, 12645, 29538, 34172, 23770, 11545, 4179, 1223, 267, 56
Offset: 1

Views

Author

Gus Wiseman, Jul 30 2018

Keywords

Examples

			Non-isomorphic representatives of the T(3,2) = 4 multiset partitions:
  {{1},{1,1}}
  {{1},{1,2}}
  {{1},{2,2}}
  {{1},{2,3}}
Triangle begins:
    1
    2    2
    3    4    3
    5   14    9    5
    7   28   33   16    7
   11   69  104   74   29   11
   15  134  294  263  142   47   15
		

Crossrefs

Row sums are A007716. First and last columns are both A000041.

Programs

  • Mathematica
    permcount[v_List] := Module[{m = 1, s = 0, k = 0, t}, For[i = 1, i <= Length[v], i++, t = v[[i]]; k = If[i > 1 && t == v[[i - 1]], k + 1, 1]; m *= t*k; s += t]; s!/m];
    c[p_List, q_List, k_] := SeriesCoefficient[1/Product[(1 - x^LCM[p[[i]], q[[j]]])^GCD[p[[i]], q[[j]]], {j, 1, Length[q]}, {i, 1, Length[p]}], {x, 0, k}];
    M[m_, n_, k_] := Module[{s = 0}, Do[Do[s += permcount[p]*permcount[q]*c[p, q, k], {q, IntegerPartitions[n]}], {p, IntegerPartitions[m]}]; s/(m!*n!)];
    T[n_, k_] := M[k, n, n] - M[k - 1, n, n];
    Table[T[n, k], {n, 1, 11}, {k, 1, n}] // Flatten (* Jean-François Alcover, Feb 08 2020, after Andrew Howroyd *)
  • PARI
    \\ See A318795 for definition of M.
    T(n,k)={M(k, n, n) - M(k-1, n, n)}
    for(n=1, 10, for(k=1, n, print1(T(n,k),", "));print) \\ Andrew Howroyd, Dec 28 2019
    
  • PARI
    \\ Faster version.
    permcount(v) = {my(m=1, s=0, k=0, t); for(i=1, #v, t=v[i]; k=if(i>1&&t==v[i-1], k+1, 1); m*=t*k; s+=t); s!/m}
    K(q, t, n)={1/prod(j=1, #q, (1-x^lcm(t, q[j]) + O(x*x^n))^gcd(t, q[j]))}
    G(m,n)={my(s=0); forpart(q=m, s+=permcount(q)*exp(sum(t=1, n, (K(q, t, n)-1)/t) + O(x*x^n))); s/m!}
    A(n,m=n)={my(p=sum(k=0, m, G(k,n)*y^k)*(1-y)); matrix(n, m, n, k, polcoef(polcoef(p, n, x), k, y))}
    { my(T=A(10)); for(n=1, #T, print(T[n,1..n])) } \\ Andrew Howroyd, Aug 30 2020

Extensions

Terms a(29) and beyond from Andrew Howroyd, Dec 28 2019

A275692 Numbers k such that every rotation of the binary digits of k is less than k.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1

Views

Author

Robert Israel, Aug 05 2016

Keywords

Comments

0, and terms of A065609 that are not in A121016.
Number of terms with d binary digits is A001037(d).
Take the binary representation of a(n), reverse it, add 1 to each digit. The result is the decimal representation of A102659(n).
From Gus Wiseman, Apr 19 2020: (Start)
Also numbers k such that the k-th composition in standard order (row k of A066099) is a Lyndon word. For example, the sequence of all Lyndon words begins:
0: () 52: (1,2,3) 118: (1,1,2,1,2)
1: (1) 56: (1,1,4) 120: (1,1,1,4)
2: (2) 58: (1,1,2,2) 122: (1,1,1,2,2)
4: (3) 60: (1,1,1,3) 124: (1,1,1,1,3)
6: (1,2) 62: (1,1,1,1,2) 126: (1,1,1,1,1,2)
8: (4) 64: (7) 128: (8)
12: (1,3) 72: (3,4) 144: (3,5)
14: (1,1,2) 80: (2,5) 160: (2,6)
16: (5) 84: (2,2,3) 164: (2,3,3)
20: (2,3) 96: (1,6) 168: (2,2,4)
24: (1,4) 98: (1,4,2) 192: (1,7)
26: (1,2,2) 100: (1,3,3) 194: (1,5,2)
28: (1,1,3) 104: (1,2,4) 196: (1,4,3)
30: (1,1,1,2) 106: (1,2,2,2) 200: (1,3,4)
32: (6) 108: (1,2,1,3) 202: (1,3,2,2)
40: (2,4) 112: (1,1,5) 208: (1,2,5)
48: (1,5) 114: (1,1,3,2) 210: (1,2,3,2)
50: (1,3,2) 116: (1,1,2,3) 212: (1,2,2,3)
(End)

Examples

			6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
    1:       1 ~ {1}
    2:      10 ~ {2}
    4:     100 ~ {3}
    6:     110 ~ {2,3}
    8:    1000 ~ {4}
   12:    1100 ~ {3,4}
   14:    1110 ~ {2,3,4}
   16:   10000 ~ {5}
   20:   10100 ~ {3,5}
   24:   11000 ~ {4,5}
   26:   11010 ~ {2,4,5}
   28:   11100 ~ {3,4,5}
   30:   11110 ~ {2,3,4,5}
   32:  100000 ~ {6}
   40:  101000 ~ {4,6}
   48:  110000 ~ {5,6}
   50:  110010 ~ {2,5,6}
   52:  110100 ~ {3,5,6}
   56:  111000 ~ {4,5,6}
   58:  111010 ~ {2,4,5,6}
(End)
		

Crossrefs

A similar concept is A328596.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is a necklace are A328595.
Binary necklaces are A000031.
Binary Lyndon words are A001037.
Lyndon compositions are A059966.
Length of Lyndon factorization of binary expansion is A211100.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
Length of co-Lyndon factorization of reversed binary expansion is A329326.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692 (this sequence).
- Co-Lyndon compositions are A326774.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.
- Reversed necklaces are A333943.

Programs

  • Maple
    filter:= proc(n) local L, k;
      L:= convert(convert(n,binary),string);
      for k from 1 to length(L)-1 do
        if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
      od;
      true
    end proc:
    select(filter, [$0..1000]);
  • Mathematica
    filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
    Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
  • Python
    def ok(n):
        b = bin(n)[2:]
        return all(b[i:] + b[:i] < b for i in range(1, len(b)))
    print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022
Showing 1-10 of 145 results. Next