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.

A210524 a(n) = n - sum of even digits of n.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 10, 11, 10, 13, 10, 15, 10, 17, 10, 19, 18, 19, 18, 21, 18, 23, 18, 25, 18, 27, 30, 31, 30, 33, 30, 35, 30, 37, 30, 39, 36, 37, 36, 39, 36, 41, 36, 43, 36, 45, 50, 51, 50, 53, 50, 55, 50, 57, 50, 59, 54, 55, 54, 57, 54, 59, 54, 61
Offset: 0

Views

Author

Marco Piazzalunga, Jan 27 2013

Keywords

Comments

In even positions there are odd terms.
The difference between n and even digits of n and n has odd and even digits gives even terms finishing with 0.

Examples

			a(14) = 14 - 4 = 10.
a(28) = 28 - 2 - 8 = 18.
		

Crossrefs

Cf. A066568.

Programs

  • Mathematica
    Table[n-Total[Select[IntegerDigits[n],EvenQ]],{n,0,90}] (* Harvey P. Dale, May 20 2017 *)
  • PARI
    a(n) = {digs = digits(n, 10); return (n - sum(i=1, #digs, digs[i]*(1 - (digs[i] % 2))));} \\ Michel Marcus, Jul 15 2013

Formula

a(n) ~ n. a(n) = n mod 2. - Charles R Greathouse IV, Jan 28 2013