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.

A118733 Numbers k such that 3^k has even digit sum.

Original entry on oeis.org

6, 7, 8, 12, 15, 19, 23, 24, 28, 29, 33, 37, 38, 40, 42, 43, 44, 46, 47, 49, 50, 54, 55, 56, 57, 58, 64, 67, 70, 71, 72, 75, 77, 82, 83, 84, 85, 88, 90, 93, 94, 95, 96, 97, 102, 104, 106, 107, 109, 110, 111, 112, 116, 120, 122, 125, 126, 129, 132, 135, 136, 138, 139
Offset: 1

Views

Author

Zak Seidov, May 22 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[140], Mod[ Plus @@ IntegerDigits[3^# ], 2] == 0 &] (* Ray Chandler, Jun 10 2006 *)
    Select[Range[150],EvenQ[Total[IntegerDigits[3^#]]]&] (* Harvey P. Dale, Mar 12 2013 *)
  • Python
    from gmpy2 import digits
    def ok(n): return sum(map(int, digits(3**n)))&1 == 0
    print([k for k in range(140) if ok(k)]) # Michael S. Branicky, May 11 2025