A213969 List of primitive words over the alphabet {1,2}.
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
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.
Links
- Robert Israel, Table of n, a(n) for n = 1..16222 (all terms with up to 13 digits)
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
Comments