login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A316863 Number of times 2 appears in the decimal expansion of n. 6
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,23

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

FORMULA

G.f.: (1-x)^(-1)*Sum_{k>=0} (x^(2*10^k)-x^(3*10^k))/(1-x^(10^(k+1))). - Robert Israel, Apr 21 2020

EXAMPLE

a(0) = 0 since the decimal representation of 0 does not contain the digit 2.

a(2) = 1 since 2 appears once in the decimal expansion of 2.

a(22) = 2 since 2 appears twice in the decimal expansion of 22.

MAPLE

f:= n -> numboccur(2, convert(n, base, 10)):

map(f, [$0..200]); # Robert Israel, Apr 21 2020

MATHEMATICA

Array[ DigitCount[#, 10, 2] &, 105, 0]

PROG

(PARI) a(n) = #select(x->x==2, digits(n)); \\ Michel Marcus, Jul 20 2018

CROSSREFS

Cf. A000027, A001477.

Cf. A043497, A043498, A043499, A043500.

Cf. A055641, A268643, A316864, A316865, A316866, A316867, A316868, A316869, A102683.

Sequence in context: A173120 A025920 A037821 * A037911 A176046 A172090

Adjacent sequences:  A316860 A316861 A316862 * A316864 A316865 A316866

KEYWORD

base,easy,nonn

AUTHOR

Robert G. Wilson v, Jul 15 2018

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 29 16:43 EDT 2020. Contains 334704 sequences. (Running on oeis4.)