login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
a(n) = 0 iff n is in A014263. - Bernard Schott, Mar 17 2023
MAPLE
A071649 := proc(n)
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 ;
end proc: # R. J. Mathar, Feb 02 2015
MATHEMATICA
Table[Total[Select[IntegerDigits[n], OddQ[#] &]], {n, 92}] (* Jayanta Basu, May 23 2013 *)
PROG
(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) A071649(n)=vecsum(select(d->bittest(d, 0), digits(n))) \\ Nearly twice as fast. - M. F. Hasler, Dec 09 2018
(Python)
A071649 = lambda x: sum(d for d in map(int, str(x)) if d&1) # M. F. Hasler, Dec 07 2022
CROSSREFS
a(n) = A007953(n) - A071648(n).
Sequence in context: A167465 A193356 A347347 * A341310 A352505 A210524
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, May 28 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)