OFFSET
1,1
COMMENTS
All the numbers are multiples of 3.
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..680 (All terms up to 10^8.)
EXAMPLE
The ternary representations of 15, 42, 45 are 120, 1120, 1200.
MATHEMATICA
Map[#[[1]] &, Select[Map[{#, Map[#[[1]] &, Split[IntegerDigits[#, 3]]] == {1, 2, 0}} &,
Range[0, 4000, 3]], #[[2]] &]] (* this sequence *)
Map[IntegerString[#, 3] &, %] (* A371051 *)
(* Peter J. C. Moses, Mar 06 2024 *)
Take[With[{nn=6}, Flatten[Table[FromDigits[Join[PadRight[{}, d1, 1], PadRight[{}, d2, 2], PadRight[{}, d0, 0]], 3], {d1, nn}, {d2, nn}, {d0, nn}]]//Union], 50] (* or *) trrQ[n_]:=With[{sp=Split[IntegerDigits[n, 3]]}, Length[sp]==3&&sp[[1, 1]]==1&&sp[[2, 1]]==2&&sp[[3, 1]]==0]; Select[Range[3, 3600, 3], trrQ] (* Harvey P. Dale, Apr 24 2025 *)
PROG
(Python)
from itertools import count, islice
def A371050_gen(): # generator of terms
return ((3**b*(3**(l-a)-1>>1)+3**b-1)*3**(a-b) for l in count(3) for a in range(2, l) for b in range(1, a))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Mar 17 2024
STATUS
approved
