%I #17 Mar 10 2014 01:22:27
%S 1,2,3,12,13,21,23,31,32,112,113,121,122,123,131,132,133,211,212,213,
%T 221,223,231,232,233,311,312,313,321,322,323,331,332,1112,1113,1121,
%U 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
%N List of primitive words on {1,2,3}.
%C 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.
%C This sequence is the complement of A239018 in A007932.
%C It is the analog for {1,2,3} of A213969 for {1,2}.
%C 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.
%F A239017 = A007932 \ A239018.
%o (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])}
%o 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",")))
%Y Cf. A213969 - A213974.
%K nonn,base
%O 1,2
%A _M. F. Hasler_, Mar 08 2014