OFFSET
1,3
COMMENTS
Record values and occurrences of A004185. - Reinhard Zumkeller, Dec 05 2009
A193581(a(n)) = 0. - Reinhard Zumkeller, Aug 10 2011
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
REFERENCES
Amarnath Murthy and Robert J. Clarke, Some Properties of Staircase sequence, Mathematics & Informatics Quarterly, Volume 11, No. 4, November 2001.
Frank A. Hanna, The Compilation of Manufacturing Statistics. U.S. Department of Commerce, Bureau of the Census, 1959.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Reinhard Zumkeller)
David Applegate, Marc LeBrun, N. J. A. Sloane, Dismal Arithmetic, J. Int. Seq. 14 (2011) # 11.9.8.
David Radcliffe and Brendan McKay, Re: A009994, SeqFan list, Jul 29 2019
Eric Weisstein's World of Mathematics, Digit.
FORMULA
a(n) >> exp(n^(1/10)). - Charles R Greathouse IV, Mar 15 2014
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
MAPLE
A[0]:= [0]: A[1]:= [$1..9]:
for d from 2 to 4 do
A[d]:= map(t -> seq(10*t+i, i=(t mod 10) .. 9), A[d-1]):
od:
seq(op(A[d]), d=0..4); # Robert Israel, Jul 28 2019
MATHEMATICA
Select[Range[0, 125], LessEqual@@IntegerDigits[#] &] (* Ray Chandler, Oct 25 2011 *)
PROG
(Haskell)
import Data.Set (fromList, deleteFindMin, insert)
a009994 n = a009994_list !! n
a009994_list = 0 : f (fromList [1..9]) where
f s = m : f (foldl (flip insert) s' $ map (10*m +) [m `mod` 10 ..9])
where (m, s') = deleteFindMin s
-- Reinhard Zumkeller, Aug 10 2011
(PARI) is(n)=n=digits(n); n==vecsort(n) \\ Charles R Greathouse IV, Dec 03 2013
(Python)
from itertools import combinations_with_replacement
def A009994generator():
yield 0
l = 1
while True:
for i in combinations_with_replacement('123456789', l):
yield int(''.join(i))
l += 1 # Chai Wah Wu, Nov 11 2015
(Magma) [k:k in [0..122]|Sort(Intseq(k)) eq Reverse(Intseq(k))]; // Marius A. Burtea, Jul 28 2019
(Scala) def hasDigitsSorted(n: Int): Boolean = {
val digSort = Integer.parseInt(n.toString.toCharArray.sorted.mkString)
n == digSort
}
(0 to 200).filter(hasDigitsSorted(_)) // Alonso del Arte, Apr 20 2020
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved