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.

A214218 List of words over {1,2} with equal numbers of 1's and 2's.

This page as a plain text file.
%I A214218 #27 Dec 21 2021 10:46:46
%S A214218 12,21,1122,1212,1221,2112,2121,2211,111222,112122,112212,112221,
%T A214218 121122,121212,121221,122112,122121,122211,211122,211212,211221,
%U A214218 212112,212121,212211,221112,221121,221211,222111,11112222,11121222,11122122,11122212,11122221
%N A214218 List of words over {1,2} with equal numbers of 1's and 2's.
%C A214218 Of course the empty word also has this property.
%C A214218 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
%C A214218 The semiprime subsequence contains 21, 11222121, 12122211, 21221121, 22211121, 22212111, and continues with 14 10-digit entries etc. - _R. J. Mathar_, Jul 19 2012
%D A214218 J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 2.
%H A214218 Harvey P. Dale, <a href="/A214218/b214218.txt">Table of n, a(n) for n = 1..1000</a>
%p A214218 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
%t A214218 Sort[FromDigits/@Flatten[Table[Permutations[PadRight[{},2n,{1,2}]],{n,3}],1]] (* _Harvey P. Dale_, Aug 30 2016 *)
%o A214218 (Python)
%o A214218 from itertools import count, islice
%o A214218 from sympy.utilities.iterables import multiset_permutations as mp
%o A214218 def agen():
%o A214218     for d in count(2, 2):
%o A214218         for s in mp("1"*(d//2) + "2"*(d//2), d):
%o A214218             yield int("".join(s))
%o A214218 print(list(islice(agen(), 33))) # _Michael S. Branicky_, Dec 21 2021
%Y A214218 Subsequence of A007931, A111066.
%K A214218 nonn,base
%O A214218 1,1
%A A214218 _N. J. A. Sloane_, Jul 18 2012