%I #77 Dec 05 2024 12:03:45
%S 9,19,29,39,49,59,69,79,89,90,91,92,93,94,95,96,97,98,99,109,119,129,
%T 139,149,159,169,179,189,190,191,192,193,194,195,196,197,198,199,209,
%U 219,229,239,249,259,269,279,289,290,291,292,293,294,295,296,297,298
%N "9ish numbers": decimal representation contains at least one nine.
%C The 9ish numbers are closed under lunar multiplication. The lunar primes (A087097) are a subset.
%C Almost all numbers are 9ish, in the sense that the asymptotic density of this set is 1: Among the 9*10^(n-1) n-digit numbers, only a fraction of 0.8*0.9^(n-1) doesn't have a digit 9, and this fraction tends to zero (< 1/10^k for n > 22k-3). This explains the formula a(n) ~ n. - _M. F. Hasler_, Nov 19 2018
%C A 9ish number is a number whose largest decimal digit is 9. - _Stefano Spezia_, Nov 16 2023
%H Reinhard Zumkeller, <a href="/A011539/b011539.txt">Table of n, a(n) for n = 1..10000</a>
%H D. Applegate, <a href="/A087061/a087061.txt">C program for lunar arithmetic and number theory</a> [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]
%H D. Applegate, M. LeBrun, and N. J. A. Sloane, <a href="http://arxiv.org/abs/1107.1130">Dismal Arithmetic</a>, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]
%H <a href="/index/Di#dismal">Index entries for sequences related to dismal (or lunar) arithmetic</a>
%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%F Complement of A007095. A102683(a(n)) > 0 (defines this sequence). A068505(a(n)) = a(n): fixed points of A068505 are the terms of this sequence and the numbers < 9. - _Reinhard Zumkeller_, Dec 29 2011, edited by _M. F. Hasler_, Nov 16 2018
%F a(n) ~ n. - _Charles R Greathouse IV_, May 15 2013
%e E.g. 9, 19, 69, 90, 96, 99 and 1234567890 are all 9ish.
%p seq(`if`(numboccur(9, convert(n, base, 10))>0, n, NULL), n=0..100); # _François Marques_, Oct 12 2020
%t Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 10 ], 9 ]>0)& ] (* _François Marques_, Oct 12 2020 *)
%t Select[Range[300],DigitCount[#,10,9]>0&] (* _Harvey P. Dale_, Mar 04 2023 *)
%o (Haskell)
%o a011539 n = a011539_list !! (n-1)
%o a011539_list = filter ((> 0) . a102683) [1..] -- _Reinhard Zumkeller_, Dec 29 2011
%o (PARI) is(n)=n=vecsort(digits(n));n[#n]==9 \\ _Charles R Greathouse IV_, May 15 2013
%o (PARI) select( is_A011539(n)=vecmax(digits(n))==9, [1..300]) \\ _M. F. Hasler_, Nov 16 2018
%o (GAP) Filtered([1..300],n->9 in ListOfDigits(n)); # _Muniru A Asiru_, Feb 25 2019
%o (Python)
%o def ok(n): return '9' in str(n)
%o print(list(filter(ok, range(299)))) # _Michael S. Branicky_, Sep 19 2021
%o (Python)
%o def A011539(n):
%o def f(x):
%o l = (s:=str(x)).find('9')
%o if l >= 0: s = s[:l]+'8'*(len(s)-l)
%o return n+int(s,9)
%o m, k = n, f(n)
%o while m != k: m, k = k, f(k)
%o return m # _Chai Wah Wu_, Dec 04 2024
%Y Cf. A088924 (number of n-digit terms).
%Y Cf. A087062 (lunar product), A087097 (lunar primes).
%Y A102683 (number of digits 9 in n); fixed points > 8 of A068505.
%Y Cf. Numbers with at least one digit b-1 in base b : A074940 (b=3), A337250 (b=4), A337572 (b=5), A333656 (b=6), A337141 (b=7), A337239 (b=8), A338090 (b=9), this sequence (b=10), A095778 (b=11).
%Y Cf. Numbers with no digit b-1 in base b: A005836 (b=3), A023717 (b=4), A020654 (b=5), A037465 (b=6), A020657 (b=7), A037474 (b=8), A037477 (b=9), A007095 (b=10), A171397 (b=11).
%Y Supersequence of A043525.
%K nonn,base,easy
%O 1,1
%A _N. J. A. Sloane_