login
A371052
Numbers whose ternary representation consists of a run of 2's, then a run of 1's, then a run of 0's.
2
21, 63, 66, 75, 189, 198, 201, 225, 228, 237, 567, 594, 603, 606, 675, 684, 687, 711, 714, 723, 1701, 1782, 1809, 1818, 1821, 2025, 2052, 2061, 2064, 2133, 2142, 2145, 2169, 2172, 2181, 5103, 5346, 5427, 5454, 5463, 5466
OFFSET
1,1
COMMENTS
All the numbers are multiples of 3.
LINKS
EXAMPLE
The ternary representations of 21, 63, 66 are 210, 2100, 2110.
MAPLE
seq(seq(seq((2*(3^d-3^(d-a))+3^(d-a)-3^(d-a-b))/2, b=1..d-1-a), a=1..d-2), d=3..10); # Robert Israel, Mar 21 2024
MATHEMATICA
Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {2, 1, 0}} &,
Range[0, 6000, 3]], #[[2]] &]] (* this sequence *)
ToExpression[Map[IntegerString[#, 3] &, %]] (* A371053 *)
(* Peter J. C. Moses, Mar 06 2024 *)
PROG
(Python)
from itertools import count, islice
def A371052_gen(): # generator of terms
return ((3**b*(3**a-1)+(3**b-1>>1))*3**(l-a-b) for l in count(3) for a in range(1, l-1) for b in range(1, l-a))
A371052_list = list(islice(A371052_gen(), 20)) # Chai Wah Wu, Mar 21 2024
CROSSREFS
KEYWORD
nonn,base,look
AUTHOR
Clark Kimberling, Mar 17 2024
STATUS
approved