login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A371056
Numbers whose ternary representation consists of a run of 2's, then a run of 0's, then a run of 1's.
1
19, 55, 58, 73, 163, 166, 175, 217, 220, 235, 487, 490, 499, 526, 649, 652, 661, 703, 706, 721, 1459, 1462, 1471, 1498, 1579, 1945, 1948, 1957, 1984, 2107, 2110, 2119, 2161, 2164, 2179, 4375, 4378, 4387, 4414, 4495, 4738, 5833, 5836, 5845, 5872, 5953, 6319
OFFSET
1,1
COMMENTS
a(n) == 1 mod 3 for all n.
MATHEMATICA
Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {2, 0, 1}} &, Range[1, 36000, 3]], #[[2]] &]] (* this sequence *)
ToExpression[Map[IntegerString[#, 3] &, %]] (* A371057 *)
(* Peter J. C. Moses, Mar 06 2024 *)
PROG
(Python)
from itertools import count, islice
def A371056_gen(): # generator of terms
return (3**(l-a)*(3**a-1)+(3**b-1>>1) for l in count(3) for a in range(1, l-1) for b in range(1, l-a))
A371056_list = list(islice(A371056_gen(), 20)) # Chai Wah Wu, Mar 30 2024
CROSSREFS
Sequence in context: A288144 A051871 A371110 * A044121 A044502 A069131
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Mar 22 2024
STATUS
approved