Nothing Special   »   [go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A316868
Number of times 7 appears in decimal expansion of n.
8
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, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 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
OFFSET
0,78
EXAMPLE
a(0) = 0 since the decimal representation of 0 does not contain the digit 7.
a(7) = 1 since 7 appears once in the decimal expansion of 7.
MATHEMATICA
Array[ DigitCount[#, 10, 7] &, 105, 0]
PROG
(PARI) a(n) = #select(x->x==7, digits(n)); \\ Michel Marcus, Jul 20 2018
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Jul 15 2018
STATUS
approved