[go: up one dir, main page]

login
A316864 revision #12

A316864
Number of digits 3 in decimal representation of n.
9
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, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 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
OFFSET
0,34
EXAMPLE
a(0) = 0 since the decimal representation of 0 has no digit of 3 in it.
a(3) = 1 since the decimal representation of 3 has one digit of 3 in it.
a(3) = 2 since the decimal representation of 33 has two digits of 3 in it.
MATHEMATICA
Array[ DigitCount[#, 10, 3] &, 105, 0]
PROG
(PARI) a(n) = #select(x->x==3, digits(n)); \\ Michel Marcus, Jul 20 2018
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Jul 15 2018
EXTENSIONS
See my changes to A316863 and make similar changes here - and then delete this line
STATUS
editing