login
A023693
Numbers with exactly 2 1's in ternary expansion.
4
4, 10, 12, 14, 16, 22, 28, 30, 32, 34, 36, 38, 42, 44, 46, 48, 50, 52, 58, 64, 66, 68, 70, 76, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 106, 108, 110, 114, 116, 126, 128, 132, 134, 136, 138, 140, 142, 144, 146, 150, 152, 154, 156, 158, 160, 166, 172, 174
OFFSET
1,1
COMMENTS
From Bernard Schott, Jun 19 2023: (Start)
A003946 \ {1} is a subsequence since for m = 4*3^(k-1) with k >= 1, ternary expansion of m is 110...0 with (k-1) trailing 0's.
A034472 \ {2} is a subsequence since for m = 3^k + 1 with k >= 1, ternary expansion of m is 10...01 with (k-1) 0's between first and last 1's. (End)
LINKS
EXAMPLE
30 is a term since 30 = 1010_3 with exactly 2 1's.
MATHEMATICA
Select[ Range[ 162 ], (Count[ IntegerDigits[ #, 3 ], 1 ]==2)& ]
PROG
(PARI) isok(k) = #select(x->(x==1), digits(k, 3)) == 2; \\ Michel Marcus, Jun 19 2023
CROSSREFS
KEYWORD
nonn,base,easy
STATUS
approved