OFFSET
1,1
COMMENTS
Of course the empty word also has this property.
All of these, interpreted as decimal integers are divisible by 3, because each pair of "1" and "2" contributes a digital sum of 3, hence the total is divisible by 3. Is there a semiprime in the sequence after 21? - Jonathan Vos Post, Jul 18 2012
The semiprime subsequence contains 21, 11222121, 12122211, 21221121, 22211121, 22212111, and continues with 14 10-digit entries etc. - R. J. Mathar, Jul 19 2012
REFERENCES
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 2.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
MAPLE
sort([seq(seq((10^(2*d)-1)/9+add(10^i, i=s), s=combinat:-choose([$0..(2*d-1)], d)), d=1..4)]); # Robert Israel, Jan 02 2018
MATHEMATICA
Sort[FromDigits/@Flatten[Table[Permutations[PadRight[{}, 2n, {1, 2}]], {n, 3}], 1]] (* Harvey P. Dale, Aug 30 2016 *)
PROG
(Python)
from itertools import count, islice
from sympy.utilities.iterables import multiset_permutations as mp
def agen():
for d in count(2, 2):
for s in mp("1"*(d//2) + "2"*(d//2), d):
yield int("".join(s))
print(list(islice(agen(), 33))) # Michael S. Branicky, Dec 21 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jul 18 2012
STATUS
approved