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.

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

This page as a plain text file.
%I A239018 #8 Nov 22 2021 08:41:27
%S A239018 11,22,33,111,222,333,1111,1212,1313,2121,2222,2323,3131,3232,3333,
%T A239018 11111,22222,33333,111111,112112,113113,121121,121212,122122,123123,
%U A239018 131131,131313,132132,133133,211211,212121,212212,213213,221221,222222,223223,231231,232232,232323,233233,311311,312312,313131,313313
%N A239018 Non-primitive words on {1,2,3}.
%C A239018 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.
%C A239018 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.
%C A239018 This is the complement of A239017 in A007932.
%C A239018 This is for {1,2,3} what A213972 is for {1,2} (and A213973 for {1,3}, A213974 for {2,3}).
%H A239018 Michael S. Branicky, <a href="/A239018/b239018.txt">Table of n, a(n) for n = 1..10239</a> (all terms with <= 16 digits)
%o A239018 (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",")))
%o A239018 (Python)
%o A239018 from sympy import divisors
%o A239018 from itertools import product
%o A239018 def agentod(maxd):
%o A239018     for d in range(2, maxd+1):
%o A239018         divs, alld = divisors(d)[:-1], set()
%o A239018         for div in divs:
%o A239018             for t in product("123", repeat=div):
%o A239018                 alld.add(int("".join(t*(d//div))))
%o A239018         yield from sorted(alld)
%o A239018 print([an for an in agentod(6)]) # _Michael S. Branicky_, Nov 22 2021
%Y A239018 Cf. A102659, A213969 - A213974.
%Y A239018 Cf. A007932, A239017.
%K A239018 nonn
%O A239018 1,1
%A A239018 _M. F. Hasler_, Mar 08 2014