|
|
A071649
|
|
Sum of odd decimal digits of n.
|
|
12
|
|
|
1, 0, 3, 0, 5, 0, 7, 0, 9, 1, 2, 1, 4, 1, 6, 1, 8, 1, 10, 0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 3, 4, 3, 6, 3, 8, 3, 10, 3, 12, 0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 5, 6, 5, 8, 5, 10, 5, 12, 5, 14, 0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 7, 8, 7, 10, 7, 12, 7, 14, 7, 16, 0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 9, 10, 9
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
local a, d;
a := 0 ;
for d in convert(n, base, 10) do
if type(d, 'odd') then
a := a+d ;
end if;
end do:
a ;
|
|
MATHEMATICA
|
Table[Total[Select[IntegerDigits[n], OddQ[#] &]], {n, 92}] (* Jayanta Basu, May 23 2013 *)
|
|
PROG
|
(PARI) A071649(n)=vecsum(select(d->bittest(d, 0), digits(n))) \\ Nearly twice as fast. - M. F. Hasler, Dec 09 2018
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|