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.

A371054 Numbers whose ternary representation consists of a run of 1's, then a run of 0's, then a run of 2's.

This page as a plain text file.
%I A371054 #18 Mar 29 2025 17:00:47
%S A371054 11,29,35,38,83,89,107,110,116,119,245,251,269,323,326,332,350,353,
%T A371054 359,362,731,737,755,809,971,974,980,998,1052,1055,1061,1079,1082,
%U A371054 1088,1091,2189,2195,2213,2267,2429,2915,2918,2924,2942,2996,3158,3161,3167,3185
%N A371054 Numbers whose ternary representation consists of a run of 1's, then a run of 0's, then a run of 2's.
%C A371054 a(n) == 2 (mod 3) for all n.
%t A371054 Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {1, 0, 2}} &,
%t A371054 Range[2, 4000, 3]], #[[2]] &]]  (* this sequence *)
%t A371054 ToExpression[Map[IntegerString[#, 3] &, %]]  (* A371055 *)
%t A371054 (* _Peter J. C. Moses_, Mar 06 2024 *)
%t A371054 Take[With[{nn=6},Flatten[Table[FromDigits[Join[PadRight[{},z,1],PadRight[{},o,0],PadRight[{},t,2]],3],{z,nn},{o,nn},{t,nn}]]]//Sort,50] (* _Harvey P. Dale_, Mar 29 2025 *)
%o A371054 (Python)
%o A371054 from itertools import count, islice
%o A371054 def A371054_gen(): # generator of terms
%o A371054     return (3**(l-a)*(3**a-1>>1)+3**b-1 for l in count(3) for a in range(1,l-1) for b in range(1,l-a))
%o A371054 A371054_list = list(islice(A371054_gen(),20)) # _Chai Wah Wu_, Mar 20 2024
%Y A371054 Cf. A007089, A371055.
%K A371054 nonn,base
%O A371054 1,1
%A A371054 _Clark Kimberling_, Mar 19 2024