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

A213969 List of primitive words over the alphabet {1,2}.

Original entry on oeis.org

1, 2, 12, 21, 112, 121, 122, 211, 212, 221, 1112, 1121, 1122, 1211, 1221, 1222, 2111, 2112, 2122, 2211, 2212, 2221, 11112, 11121, 11122, 11211, 11212, 11221, 11222, 12111, 12112, 12121, 12122, 12211, 12212, 12221, 12222, 21111, 21112, 21121, 21122, 21211, 21212, 21221, 21222, 22111, 22112, 22121, 22122, 22211, 22212, 22221
Offset: 1

Views

Author

N. J. A. Sloane, Jun 30 2012

Keywords

Comments

A word w is primitive if it cannot be written as u^k with k>1; otherwise it is imprimitive.
The {0,1} version of this sequence is
0, 1, 01, 10, 001, 010, 011, 100, 101, 110, 0001, 0010, 0011, 0100, 0110, 0111, 1000, 1001, 1011, 1100, 1101, 1110, 00001, 00010, 00011, 00100, 00101, 00110, 00111, 01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, ...,
but this cannot be included as a sequence in the OEIS since it contains nonzero "numbers" beginning with 0.
Lyndon words on {1,2}, A102659, are the numbers in this sequence which are also not larger than any of their rotations, i.e., in A239016. - M. F. Hasler, Mar 08 2014

References

  • A. de Luca and S. Varricchio, Finiteness and Regularity in Semigroups and Formal Languages, Monographs in Theoretical Computer Science, Springer-Verlag, Berlin, 1999. See p. 10.

Crossrefs

Programs

  • Maple
    P:= proc(d) local m,A;
        A:= map(t -> (10^d-1)/9 + add(10^s, s = t), combinat:-powerset([$0..d-1]));
        for m in numtheory:-divisors(d) minus {d} do
          A:= remove(t -> t = (t mod 10^m)*(10^d-1)/(10^m-1), A);
        od;
        op(sort(A));
    end proc:
    seq(P(d),d=1..6); # Robert Israel, Mar 24 2017
  • Mathematica
    j[w_, k_] := FromDigits /@ (Flatten[Table[#, {k}]] & /@ w); L[n_] := Complement[ FromDigits /@ Tuples[{1, 2}, n], Union[ Flatten[( j[Tuples[{1, 2}, #1], n/#1] &) /@ Most[ Divisors[n]]]]]; Flatten@ Array[L, 5] (* Giovanni Resta, Mar 24 2017 *)
  • PARI
    is_A213969(n)={fordiv(#n=digits(n),L,L<#n&&n==concat(Col(vector(#n/L,i,1)~*vecextract(n,2^L-1))~)&&return);!setminus(Set(n),[1,2])}
    for(n=1,5,p=vector(n,i,10^(n-i))~;forvec(d=vector(n,i,[1,2]),is_A213969(m=d*p)&&print1(m","))) \\ M. F. Hasler, Mar 08 2014

A239018 Non-primitive words on {1,2,3}.

Original entry on oeis.org

11, 22, 33, 111, 222, 333, 1111, 1212, 1313, 2121, 2222, 2323, 3131, 3232, 3333, 11111, 22222, 33333, 111111, 112112, 113113, 121121, 121212, 122122, 123123, 131131, 131313, 132132, 133133, 211211, 212121, 212212, 213213, 221221, 222222, 223223, 231231, 232232, 232323, 233233, 311311, 312312, 313131, 313313
Offset: 1

Views

Author

M. F. Hasler, Mar 08 2014

Keywords

Comments

A word is non-primitive if it is a nontrivial power (i.e., repetition) of a subword. Therefore, for a prime number of digits, only the repdigit numbers are primitive. For words with 6 letters, there is also 112^2,113^2,121^2,12^3,... where w^n means n concatenations of w.
Lyndon words on {1,2,3}, A102660, are the terms in A007932 which are primitive (i.e., in the complement A239017 of this sequence) and not larger than any of their rotation, i.e., in A239016.
This is the complement of A239017 in A007932.
This is for {1,2,3} what A213972 is for {1,2} (and A213973 for {1,3}, A213974 for {2,3}).

Crossrefs

Programs

  • PARI
    for(n=1,7,p=vector(n,i,10^(n-i))~;forvec(d=vector(n,i,[1,3]),is_A239017(m=d*p)||print1(m",")))
    
  • Python
    from sympy import divisors
    from itertools import product
    def agentod(maxd):
        for d in range(2, maxd+1):
            divs, alld = divisors(d)[:-1], set()
            for div in divs:
                for t in product("123", repeat=div):
                    alld.add(int("".join(t*(d//div))))
            yield from sorted(alld)
    print([an for an in agentod(6)]) # Michael S. Branicky, Nov 22 2021

A213972 List of imprimitive words over the alphabet {1,2}.

Original entry on oeis.org

11, 22, 111, 222, 1111, 1212, 2121, 2222, 11111, 22222, 111111, 112112, 121121, 121212, 122122, 211211, 212121, 212212, 221221, 222222, 1111111, 2222222, 11111111, 11121112, 11211121, 11221122, 12111211, 12121212, 12211221, 12221222, 21112111, 21122112, 21212121
Offset: 1

Views

Author

N. J. A. Sloane, Jun 30 2012

Keywords

Comments

A word w is primitive if it cannot be written as u^k with k>1; otherwise it is imprimitive.
The {0,1} version of this sequence is
00, 11, 000, 111, 0000, 0101, 1010, 1111, 00000, 11111, 000000, 001001, 010010, 010101, 011011, 100100, 101010, 101101, 110110, 111111
but this cannot be included as a sequence in the OEIS since it contains nonzero "numbers" beginning with 0.
This sequence results from A213973 by replacing all digits 3 by 2 and from A213974 by replacing digits 2 by 1 and digits 3 by 2. - M. F. Hasler, Mar 10 2014

References

  • A. de Luca and S. Varricchio, Finiteness and Regularity in Semigroups and Formal Languages, Monographs in Theoretical Computer Science, Springer-Verlag, Berlin, 1999. See p. 10.

Crossrefs

See A239018 for the analog over the alphabet {1,2,3}.

Programs

  • Maple
    P:= proc(d) option remember;local m,A;
        A:= map(t -> (10^d-1)/9 + add(10^s, s = t), combinat:-powerset([$0..d-1]));
        for m in numtheory:-divisors(d) minus {d} do
          A:= remove(t -> t = (t mod 10^m)*(10^d-1)/(10^m-1), A);
        od;
        sort(A);
    end proc:
    IP:= proc(d)
       sort([seq(seq(s*(10^d-1)/(10^m-1), s = P(m)), m=numtheory:-divisors(d) minus {d})]);
    end proc:
    seq(op(IP(d)), d=1..10); # Robert Israel, Mar 24 2017
  • Mathematica
    j[w_, k_] := FromDigits /@ (Flatten[Table[#, {k}]] & /@ w); Flatten@ Table[ Union@ Flatten[ j[Tuples [{1, 2}, #], n/#] & /@ Most@ Divisors@ n], {n, 9}] (* Giovanni Resta, Mar 24 2017 *)
  • PARI
    for(n=1, 10, p=vector(n, i, 10^(n-i))~; forvec(d=vector(n, i, [1, 2]), is_A239017(m=d*p)||print1(m", "))) \\ M. F. Hasler, Mar 10 2014

Formula

A213972 = A007931 intersect A239018. - M. F. Hasler, Mar 10 2014

Extensions

More terms from M. F. Hasler, Mar 10 2014

A213973 List of imprimitive words over the alphabet {1,3}.

Original entry on oeis.org

11, 33, 111, 333, 1111, 1313, 3131, 3333, 11111, 33333, 111111, 113113, 131131, 131313, 133133, 311311, 313131, 313313, 331331, 333333, 1111111, 3333333, 11111111, 11131113, 11311131, 11331133, 13111311, 13131313, 13311331, 13331333, 31113111, 31133113, 31313131
Offset: 1

Views

Author

N. J. A. Sloane, Jun 30 2012

Keywords

Comments

A word w is primitive if it cannot be written as u^k with k>1; otherwise it is imprimitive.
The {0,1} version of this sequence is
00, 11, 000, 111, 0000, 0101, 1010, 1111, 00000, 11111, 000000, 001001, 010010, 010101, 011011, 100100, 101010, 101101, 110110, 111111
but this cannot be included as a sequence in the OEIS since it contains nonzero "numbers" beginning with 0.
This sequence results from A213972 by replacing all digits 2 by 3, and from A213974 by replacing all digits 2 by 1. - M. F. Hasler, Mar 10 2014

References

  • A. de Luca and S. Varricchio, Finiteness and Regularity in Semigroups and Formal Languages, Monographs in Theoretical Computer Science, Springer-Verlag, Berlin, 1999. See p. 10.

Crossrefs

Programs

  • PARI
    for(n=1, 8, p=2*vector(n, i, 10^(n-i))~; forvec(d=vector(n, i, [1, 3]/2), is_A239017(m=d*p)||print1(m", ")))

Formula

A213973 = A032917 intersect A239018. - M. F. Hasler, Mar 10 2014

Extensions

More terms from M. F. Hasler, Mar 10 2014

A239019 Numbers which are not primitive words over the alphabet {0,...,9} (when written in base 10).

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 111, 222, 333, 444, 555, 666, 777, 888, 999, 1010, 1111, 1212, 1313, 1414, 1515, 1616, 1717, 1818, 1919, 2020, 2121, 2222, 2323, 2424, 2525, 2626, 2727, 2828, 2929, 3030, 3131, 3232, 3333, 3434, 3535, 3636, 3737, 3838, 3939, 4040, 4141, 4242, 4343, 4444, 4545, 4646, 4747, 4848, 4949
Offset: 1

Views

Author

M. F. Hasler, Mar 08 2014

Keywords

Comments

A word is primitive iff it is not a power, i.e., repetition, of a subword. The only non-primitive words with a prime number of letters (here: digits) are the repdigit numbers. Thus, the first nontrivial terms of this sequence are 1010,1212,...
This sequence does *not* contain all non-primitive words over the alphabet {0,...,9}, namely, it excludes those which would be numbers with leading zeros: 00,000,0000,0101,0202,...
Lists of non-primitive words over a sub-alphabet of {1...9}, like A213972, A213973, A213974, A239018, ... are given as intersection of this with the set of all words in that alphabet, e.g., A007931, A032810, A032917, A007932, ...

Programs

  • Maple
    F:= proc(d) local p,R,q;
      R:= {seq(x*(10^d-1)/9, x=1..9)};
      for p in numtheory:-factorset(d) minus {d} do
        q:= d/p;
        R:= R union {seq(x*(10^d-1)/(10^q-1),x=10^(q-1)..10^q-1)};
      od:
      sort(convert(R,list))
    end proc:
    [seq(op(F(i)),i=2..4)]; # Robert Israel, Nov 14 2017
  • PARI
    is_A239019(n)=fordiv(#n=digits(n),L,L<#n && n==concat(Col(vector(#n/L,i,1)~*vecextract(n,2^L-1))~)&&return(1))

A239017 List of primitive words on {1,2,3}.

Original entry on oeis.org

1, 2, 3, 12, 13, 21, 23, 31, 32, 112, 113, 121, 122, 123, 131, 132, 133, 211, 212, 213, 221, 223, 231, 232, 233, 311, 312, 313, 321, 322, 323, 331, 332, 1112, 1113, 1121, 1122, 1123, 1131, 1132, 1133, 1211, 1213, 1221, 1222, 1223, 1231, 1232, 1233, 1311, 1312, 1321, 1322, 1323, 1331, 1332, 1333, 2111, 2112, 2113, 2122, 2123
Offset: 1

Views

Author

M. F. Hasler, Mar 08 2014

Keywords

Comments

A word is primitive if it is not a power (i.e., repetition) of a subword. The non-primitive words 11, 22, 33, 111, 222, 333, 1111, 1212, 1313, 2121, 2222, ... (cf. A239018) are excluded here.
This sequence is the complement of A239018 in A007932.
It is the analog for {1,2,3} of A213969 for {1,2}.
The Lyndon words on {1,2,3}, A102660, are the subsequence of these primitive words not larger than any of their "rotations", i.e., in A239016.

Crossrefs

Programs

  • PARI
    is_A239017(n)={fordiv(#d=digits(n),L,L<#d&&d==concat(Col(vector(#d/L,i,1)~*vecextract(d,2^L-1))~)&&return);!setminus(Set(d),[1,2,3])}
    for(n=1,5,p=vector(n,i,10^(n-i))~;forvec(d=vector(n,i,[1,3]),is_A239017(m=d*p)&&print1(m",")))

Formula

A213970 List of primitive words over the alphabet {1,3}.

Original entry on oeis.org

1, 3, 13, 31, 113, 131, 133, 311, 313, 331, 1113, 1131, 1133, 1311, 1331, 1333, 3111, 3113, 3133, 3311, 3313, 3331, 11113, 11131, 11133, 11311, 11313, 11331, 11333, 13111, 13113, 13131, 13133, 13311, 13313, 13331, 13333, 31111, 31113, 31131, 31133, 31311, 31313, 31331, 31333, 33111, 33113, 33131, 33133, 33311, 33313, 33331
Offset: 1

Views

Author

N. J. A. Sloane, Jun 30 2012

Keywords

Comments

A word w is primitive if it cannot be written as u^k with k>1; otherwise it is imprimitive.
The {0,1} version of this sequence is
0, 1, 01, 10, 001, 010, 011, 100, 101, 110, 0001, 0010, 0011, 0100, 0110, 0111, 1000, 1001, 1011, 1100, 1101, 1110, 00001, 00010, 00011, 00100, 00101, 00110, 00111, 01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, ...,
but this cannot be included as a sequence in the OEIS since it contains nonzero "numbers" beginning with 0.

References

  • A. de Luca and S. Varricchio, Finiteness and Regularity in Semigroups and Formal Languages, Monographs in Theoretical Computer Science, Springer-Verlag, Berlin, 1999. See p. 10.

Crossrefs

A213971 List of primitive words over the alphabet {2,3}.

Original entry on oeis.org

2, 3, 23, 32, 223, 232, 233, 322, 323, 332, 2223, 2232, 2233, 2322, 2332, 2333, 3222, 3223, 3233, 3322, 3323, 3332, 22223, 22232, 22233, 22322, 22323, 22332, 22333, 23222, 23223, 23232, 23233, 23322, 23323, 23332, 23333, 32222, 32223, 32232, 32233, 32322, 32323, 32332, 32333, 33222, 33223, 33232, 33233, 33322, 33323, 33332
Offset: 1

Views

Author

N. J. A. Sloane, Jun 30 2012

Keywords

Comments

A word w is primitive if it cannot be written as u^k with k>1; otherwise it is imprimitive.
The {0,1} version of this sequence is
0, 1, 01, 10, 001, 010, 011, 100, 101, 110, 0001, 0010, 0011, 0100, 0110, 0111, 1000, 1001, 1011, 1100, 1101, 1110, 00001, 00010, 00011, 00100, 00101, 00110, 00111, 01000, 01001, 01010, 01011, 01100, 01101, 01110, 01111, 10000, 10001, 10010, 10011, 10100, 10101, 10110, 10111, 11000, 11001, 11010, 11011, 11100, 11101, 11110, ...,
but this cannot be included as a sequence in the OEIS since it contains nonzero "numbers" beginning with 0.
The Lyndon words over {2,3} are the intersection of this sequence with A239016. - M. F. Hasler, Mar 10 2014
This sequence results from A213970 by replacing all digits 1 by 2, and from A213969 by replacing all digits 2 by 3 and digits 1 by 2. - M. F. Hasler, Mar 10 2014

References

  • A. de Luca and S. Varricchio, Finiteness and Regularity in Semigroups and Formal Languages, Monographs in Theoretical Computer Science, Springer-Verlag, Berlin, 1999. See p. 10.

Crossrefs

Programs

  • PARI
    for(n=1, 5, p=vector(n, i, 10^(n-i))~; forvec(d=vector(n, i, [2, 3]), is_A239017(m=d*p)&&print1(m", "))) \\ M. F. Hasler, Mar 10 2014

Formula

A213971 = A032810 intersect A239017. - M. F. Hasler, Mar 10 2014
Showing 1-8 of 8 results.