login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Ternary numbers consisting of a run of 2's, then a run of 0's, then a run of 1's.
1

%I #9 Mar 30 2024 21:19:58

%S 201,2001,2011,2201,20001,20011,20111,22001,22011,22201,200001,200011,

%T 200111,201111,220001,220011,220111,222001,222011,222201,2000001,

%U 2000011,2000111,2001111,2011111,2200001,2200011,2200111,2201111,2220001,2220011,2220111

%N Ternary numbers consisting of a run of 2's, then a run of 0's, then a run of 1's.

%C 22011 consists of the run 22, then the run 0 then the run 11.

%t Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {2, 0, 1}} &, Range[1, 36000, 3]], #[[2]] &]] (* A371056 *)

%t ToExpression[Map[IntegerString[#, 3] &, %]] (* this sequence *)

%t (* _Peter J. C. Moses_, Mar 06 2024 *)

%o (Python)

%o from itertools import count, islice

%o def A371057_gen(): # generator of terms

%o return (10**(l-a)*((10**a-1)//9<<1)+((10**b-1)//9) for l in count(3) for a in range(1,l-1) for b in range(1,l-a))

%o A371057_list = list(islice(A371057_gen(),20)) # _Chai Wah Wu_, Mar 30 2024

%Y Cf. A007089, A371056.

%K nonn,base

%O 1,1

%A _Clark Kimberling_, Mar 22 2024