OFFSET
1,1
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.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10239 (all terms with <= 16 digits)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Mar 08 2014
STATUS
approved