OFFSET
0,1
COMMENTS
LINKS
FORMULA
a(n) = if n<10 then (n mod 2) else a([n/10]) XOR (n mod 2).
EXAMPLE
a(789) = (7+8+9) mod 2 = 0;
a(790) = (7+9+0) mod 2 = 0;
a(791) = (7+9+1) mod 2 = 1.
MATHEMATICA
Array[Mod[Total[IntegerDigits[#]], 2]&, 110, 0] (* Harvey P. Dale, Feb 20 2013 *)
PROG
(PARI) a(n) = vecsum(digits(n)) % 2 \\ Jeppe Stig Nielsen, Jan 06 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Reinhard Zumkeller, Jun 28 2010
STATUS
approved