%I #16 May 20 2017 17:19:09
%S 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,
%T 18,25,18,27,30,31,30,33,30,35,30,37,30,39,36,37,36,39,36,41,36,43,36,
%U 45,50,51,50,53,50,55,50,57,50,59,54,55,54,57,54,59,54,61
%N a(n) = n - sum of even digits of n.
%C In even positions there are odd terms.
%C The difference between n and even digits of n and n has odd and even digits gives even terms finishing with 0.
%F a(n) ~ n. a(n) = n mod 2. - _Charles R Greathouse IV_, Jan 28 2013
%e a(14) = 14 - 4 = 10.
%e a(28) = 28 - 2 - 8 = 18.
%t Table[n-Total[Select[IntegerDigits[n],EvenQ]],{n,0,90}] (* _Harvey P. Dale_, May 20 2017 *)
%o (PARI) a(n) = {digs = digits(n, 10); return (n - sum(i=1, #digs, digs[i]*(1 - (digs[i] % 2))));} \\ _Michel Marcus_, Jul 15 2013
%Y Cf. A066568.
%K nonn,base,easy
%O 0,4
%A _Marco Piazzalunga_, Jan 27 2013
|