OFFSET
1,1
COMMENTS
All the numbers are multiples of 3.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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))
CROSSREFS
KEYWORD
AUTHOR
Clark Kimberling, Mar 17 2024
STATUS
approved