login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A196563 Number of even digits in decimal representation of n. 39
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,21

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

FORMULA

a(n) = A055642(n) - A196564(n);

a(A014261(n)) = 0; a(A007928(n)) > 0.

From Hieronymus Fischer, May 30 2012: (Start)

a(n) = sum_{j=0..m} (1 + floor(n/(2*10^j)) - floor(n/(2*10^j) + (1/2)),  where m=floor(log_10(n)).

a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.

a(n) = a(floor(n/10))+a(n mod 10), n>=0.

a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.

a(A014263(n)) = 1 + floor(log_5(n-1)), n>1.

G.f.: g(x) = 1 + (1/(1-x))*sum_{j>=0} x^(2*10^j)/(1+ x^10^j). (End)

MAPLE

A196563 := proc(n)

        if n =0 then

                1;

        else

                convert(n, base, 10) ;

                add(1-(d mod 2), d=%) ;

        end if:

end proc: # R. J. Mathar, Jul 13 2012

MATHEMATICA

Table[Count[Mod[IntegerDigits[n], 2], 0][n], {n, 0, 100}] (* Zak Seidov, Oct 13 2015 *)

PROG

(Haskell)

a196563 n = length [d | d <- show n, d `elem` "02468"]

-- Reinhard Zumkeller, Feb 22 2012, Oct 04 2011

(PARI) a(n) = #select(x->(!(x%2)), if (n, digits(n), [0])); \\ Michel Marcus, Oct 14 2015

CROSSREFS

Cf. A014261, A014263, A027868, A046034, A055640, A055641, A055642, A061217, A102669-A102685, A122640, A196564.

Sequence in context: A111621 A140195 A196564 * A198890 A305831 A022927

Adjacent sequences:  A196560 A196561 A196562 * A196564 A196565 A196566

KEYWORD

nonn,base

AUTHOR

Reinhard Zumkeller, Oct 04 2011

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 20 08:50 EDT 2018. Contains 313914 sequences. (Running on oeis4.)