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”).

A043521
Numbers having one 8 in base 10.
12
8, 18, 28, 38, 48, 58, 68, 78, 80, 81, 82, 83, 84, 85, 86, 87, 89, 98, 108, 118, 128, 138, 148, 158, 168, 178, 180, 181, 182, 183, 184, 185, 186, 187, 189, 198, 208, 218, 228, 238, 248, 258, 268, 278, 280, 281, 282, 283, 284, 285, 286, 287, 289, 298, 308, 318
OFFSET
1,1
MATHEMATICA
Select[Range[300], DigitCount[#, 10, 8]==1&] (* Harvey P. Dale, Jan 06 2012 *)
PROG
(PARI) is(n)=my(d=digits(n)); sum(i=1, #d, d[i]==8)==1 \\ Charles R Greathouse IV, Feb 12 2017
(Python)
def ok(n): return str(n).count('8') == 1
print(list(filter(ok, range(320)))) # Michael S. Branicky, Aug 18 2021
CROSSREFS
KEYWORD
nonn,base,easy
STATUS
approved