cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A009994 Numbers with digits in nondecreasing order.

This page as a plain text file.
%I A009994 #92 Feb 16 2025 08:32:32
%S A009994 0,1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,22,23,24,25,26,27,28,
%T A009994 29,33,34,35,36,37,38,39,44,45,46,47,48,49,55,56,57,58,59,66,67,68,69,
%U A009994 77,78,79,88,89,99,111,112,113,114,115,116,117,118,119,122
%N A009994 Numbers with digits in nondecreasing order.
%C A009994 Record values and occurrences of A004185. - _Reinhard Zumkeller_, Dec 05 2009
%C A009994 A193581(a(n)) = 0. - _Reinhard Zumkeller_, Aug 10 2011
%C A009994 This sequence was used by the U.S. Bureau of the Census in the mid-1950s to numerically code the alphabetical list of counties within a state (with some modifications for Texas). The 3-digit code has a "self-policing element" built into it and "was fairly effective in detecting the transposition of 2 digits." (Hanna 1959). - _Randy A. Becker_, Dec 11 2017
%D A009994 Amarnath Murthy and Robert J. Clarke, Some Properties of Staircase sequence, Mathematics & Informatics Quarterly, Volume 11, No. 4, November 2001.
%D A009994 Frank A. Hanna, The Compilation of Manufacturing Statistics. U.S. Department of Commerce, Bureau of the Census, 1959.
%H A009994 Seiichi Manyama, <a href="/A009994/b009994.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Reinhard Zumkeller)
%H A009994 David Applegate, Marc LeBrun, N. J. A. Sloane, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL14/Sloane/carry2.html">Dismal Arithmetic</a>, J. Int. Seq. 14 (2011) # 11.9.8.
%H A009994 David Radcliffe and Brendan McKay, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2019-July/018891.html">Re: A009994</a>, SeqFan list, Jul 29 2019
%H A009994 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Digit.html">Digit.</a>
%H A009994 <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%F A009994 a(n) >> exp(n^(1/10)). - _Charles R Greathouse IV_, Mar 15 2014
%F A009994 a(n) ~ 10^((9! n)^(1/9) - 5), since 10^(d - 1) <= a(n) < 10^d for binomial(d + 8, 9) < n <= binomial(d + 9, 9) = (d + 5 - epsilon)^9 / 9!. Using epsilon = 10/(3n) + o(1/n) gives more precise estimate. [Following Radcliffe and McKay, cf. SeqFan list.] - _M. F. Hasler_, Jul 30 2019
%p A009994 A[0]:= [0]: A[1]:= [$1..9]:
%p A009994 for d from 2 to 4 do
%p A009994   A[d]:= map(t -> seq(10*t+i,i=(t mod 10) .. 9), A[d-1]):
%p A009994 od:
%p A009994 seq(op(A[d]),d=0..4); # _Robert Israel_, Jul 28 2019
%t A009994 Select[Range[0, 125], LessEqual@@IntegerDigits[#] &] (* _Ray Chandler_, Oct 25 2011 *)
%o A009994 (Haskell)
%o A009994 import Data.Set (fromList, deleteFindMin, insert)
%o A009994 a009994 n = a009994_list !! n
%o A009994 a009994_list = 0 : f (fromList [1..9]) where
%o A009994    f s = m : f (foldl (flip insert) s' $ map (10*m +) [m `mod` 10 ..9])
%o A009994          where (m,s') = deleteFindMin s
%o A009994 -- _Reinhard Zumkeller_, Aug 10 2011
%o A009994 (PARI) is(n)=n=digits(n);n==vecsort(n) \\ _Charles R Greathouse IV_, Dec 03 2013
%o A009994 (Python)
%o A009994 from itertools import combinations_with_replacement
%o A009994 def A009994generator():
%o A009994     yield 0
%o A009994     l = 1
%o A009994     while True:
%o A009994         for i in combinations_with_replacement('123456789',l):
%o A009994             yield int(''.join(i))
%o A009994         l += 1 # _Chai Wah Wu_, Nov 11 2015
%o A009994 (Magma) [k:k in [0..122]|Sort(Intseq(k)) eq Reverse(Intseq(k))]; // _Marius A. Burtea_, Jul 28 2019
%o A009994 (Scala) def hasDigitsSorted(n: Int): Boolean = {
%o A009994   val digSort = Integer.parseInt(n.toString.toCharArray.sorted.mkString)
%o A009994   n == digSort
%o A009994 }
%o A009994 (0 to 200).filter(hasDigitsSorted(_)) // _Alonso del Arte_, Apr 20 2020
%Y A009994 Apart from the first term, a subsequence of A052382. A254143 is a subsequence.
%Y A009994 Cf. A152054, A036839.
%K A009994 nonn,base,look
%O A009994 1,3
%A A009994 _N. J. A. Sloane_