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.

A071648 Sum of even decimal digits of n.

Original entry on oeis.org

0, 2, 0, 4, 0, 6, 0, 8, 0, 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 2, 2, 4, 2, 6, 2, 8, 2, 10, 2, 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 4, 4, 6, 4, 8, 4, 10, 4, 12, 4, 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 6, 6, 8, 6, 10, 6, 12, 6, 14, 6, 0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 8, 8, 10, 8, 12, 8, 14, 8, 16, 8, 0, 0, 2
Offset: 1

Views

Author

Reinhard Zumkeller, May 28 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Array[Total@ Select[IntegerDigits@ #, EvenQ] &, 101] (* Michael De Vlieger, Dec 09 2018 *)
  • PARI
    a(n)=my(d=digits(n)); sum(i=1,#d,if(d[i]%2,,d[i])) \\ Charles R Greathouse IV, Apr 04 2014
    
  • PARI
    A071648(n)=vecsum(select(d->!bittest(d,0),digits(n))) \\ Nearly twice as fast. - M. F. Hasler, Dec 09 2018

Formula

a(n) = A007953(n) - A071649(n). (Corrected by M. F. Hasler, Dec 09 2018)