login
Numbers with digits in strictly decreasing order, sorted lexicographically.
6

%I #38 Feb 13 2024 08:13:28

%S 0,1,10,2,20,21,210,3,30,31,310,32,320,321,3210,4,40,41,410,42,420,

%T 421,4210,43,430,431,4310,432,4320,4321,43210,5,50,51,510,52,520,521,

%U 5210,53,530,531,5310,532,5320,5321,53210,54,540,541,5410,542,5420,5421

%N Numbers with digits in strictly decreasing order, sorted lexicographically.

%C Original name: "Countdown sequences, allowing gaps."

%C Only digits 0 through 9 are used. The last term is 9876543210.

%C Equals A009995, sorted lexicographically. - _Reinhard Zumkeller_, Oct 14 2015

%C There are 2^k terms starting with digit k >= 0, they start at index 2^k. The countdown sequences, i.e., digits of the n-th term, are given in rows of A272011. - _M. F. Hasler_, Dec 11 2019

%D Donald S. McDonald, Email message to N. J. A. Sloane, Oct 14 2015.

%H Reinhard Zumkeller, <a href="/A262557/b262557.txt">Table of n, a(n) for n = 1..1023</a>

%F a(n) = A009995(A263328(n)); a(A263327(n)) = A009995(n). - _Reinhard Zumkeller_, Oct 15 2015

%t A262557[n_] := FromDigits[BitLength[n] - Flatten[Position[IntegerDigits[n, 2], 1]]]; Array[A262557, 100] (* or *)

%t A262557full = Rest[Map[FromDigits, LexicographicSort[Subsets[Range[9, 0, -1]]]]] (* _Paolo Xausa_, Feb 13 2024 *)

%o (Haskell)

%o a262557 n = a262557_list !! (n-1)

%o a262557_list = 0 : f [[0]] where

%o f xss = if x < 9 then (map (read . concatMap show) zss) ++ f zss else []

%o where zss = (map (z :) $ map tail xss) ++ (map (z :) xss)

%o z = x + 1; x = head $ head xss

%o -- _Reinhard Zumkeller_, Oct 14 2015

%o (PARI) is_A262557 = is_A009995

%o apply( A262557(n)=fromdigits(Vecrev(vecextract([0..exponent(n+!n)],n))), [1..99])

%o # A262557=concat(apply(x(i)=concat(vector(i%10+1,j,if(j>1,x(i*10+j-2),i))),[0..9])) \\ _M. F. Hasler_, Dec 11 2019

%o (Python)

%o from itertools import combinations

%o afull = list(map(int, sorted("".join(c) for i in range(1, 11) for c in combinations("9876543210", i)))) # _Michael S. Branicky_, Feb 13 2024

%Y Cf. A009995, A263327, A263328.

%K nonn,base,fini,full

%O 1,3

%A _N. J. A. Sloane_, Oct 14 2015

%E New name from _M. F. Hasler_, Dec 11 2019