A023693 Numbers with exactly 2 1's in ternary expansion.
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
Examples
30 is a term since 30 = 1010_3 with exactly 2 1's.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[ Range[ 162 ], (Count[ IntegerDigits[ #, 3 ], 1 ]==2)& ]
-
PARI
isok(k) = #select(x->(x==1), digits(k, 3)) == 2; \\ Michel Marcus, Jun 19 2023
Comments