login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355274
Numbers having more even than odd digits when written in base 3.
0
0, 2, 6, 8, 9, 11, 15, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 29, 33, 35, 45, 47, 51, 53, 54, 55, 56, 57, 59, 60, 61, 62, 63, 65, 69, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 90, 92, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 110, 114, 116
OFFSET
1,2
PROG
(PARI) select( {is_A355274(n)=vecsum(n=digits(n, 3)%2)*2<#n+!n}, [0..123])
(Python)
from sympy.ntheory import digits
def ok(n):
d = digits(n, 3)[1:]
return len(d) < 2*sum(1 for di in d if di%2 == 0)
print([k for k in range(117) if ok(k)]) # Michael S. Branicky, Jul 03 2022
CROSSREFS
Cf. A072603 (same in base 2), A352546 (same in base 10).
Sequence in context: A366059 A043341 A023714 * A096507 A288428 A050675
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Jul 03 2022
STATUS
approved