A356929 Integers with an even number of even digits.
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 111, 113, 115, 117, 119, 120, 122, 124, 126, 128, 131, 133, 135
Offset: 1
Examples
13 has zero even digit, so 13 is a term. 124 has two even digits, so 124 is a term. 3578 has one even digit, so 3578 is not a term.
Links
- Olympiade Mathématique Belge, OMB 2004, Finale Maxi, Question 2.
- Index to sequences related to Olympiads.
Crossrefs
Cf. A137233.
Programs
-
Mathematica
Select[Range[120], EvenQ[Count[IntegerDigits[#], ?EvenQ]] &] (* _Amiram Eldar, Sep 05 2022 *)
-
PARI
isok(k) = (#select(x->(!(x % 2)), digits(k)) % 2) == 0; \\ Michel Marcus, Sep 06 2022
-
Python
def ok(n): return sum(1 for d in str(n) if d in "02468")%2 == 0 print([k for k in range(120) if ok(k)]) # Michael S. Branicky, Sep 05 2022
Comments