cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356929 Integers with an even number of even digits.

Original entry on oeis.org

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

Views

Author

Bernard Schott, Sep 05 2022

Keywords

Comments

Inspired by Question 2 of Olympiade Mathématique Belge 2004, Finale MAXI (see link).
The number of n-digit integers with an even number of even digits is A137233(n).

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.
		

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