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.

A262557 Numbers with digits in strictly decreasing order, sorted lexicographically.

Original entry on oeis.org

0, 1, 10, 2, 20, 21, 210, 3, 30, 31, 310, 32, 320, 321, 3210, 4, 40, 41, 410, 42, 420, 421, 4210, 43, 430, 431, 4310, 432, 4320, 4321, 43210, 5, 50, 51, 510, 52, 520, 521, 5210, 53, 530, 531, 5310, 532, 5320, 5321, 53210, 54, 540, 541, 5410, 542, 5420, 5421
Offset: 1

Views

Author

N. J. A. Sloane, Oct 14 2015

Keywords

Comments

Original name: "Countdown sequences, allowing gaps."
Only digits 0 through 9 are used. The last term is 9876543210.
Equals A009995, sorted lexicographically. - Reinhard Zumkeller, Oct 14 2015
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

References

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

Crossrefs

Programs

  • Haskell
    a262557 n = a262557_list !! (n-1)
    a262557_list = 0 : f [[0]] where
       f xss = if x < 9 then (map (read . concatMap show) zss) ++ f zss else []
               where zss = (map (z :) $ map tail xss) ++ (map (z :) xss)
                     z = x + 1; x = head $ head xss
    -- Reinhard Zumkeller, Oct 14 2015
    
  • Mathematica
    A262557[n_] := FromDigits[BitLength[n] - Flatten[Position[IntegerDigits[n, 2], 1]]]; Array[A262557, 100] (* or *)
    A262557full = Rest[Map[FromDigits, LexicographicSort[Subsets[Range[9, 0, -1]]]]] (*  Paolo Xausa, Feb 13 2024 *)
  • PARI
    is_A262557 = is_A009995
    apply( A262557(n)=fromdigits(Vecrev(vecextract([0..exponent(n+!n)],n))), [1..99])
    # 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
    
  • Python
    from itertools import combinations
    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

Formula

a(n) = A009995(A263328(n)); a(A263327(n)) = A009995(n). - Reinhard Zumkeller, Oct 15 2015

Extensions

New name from M. F. Hasler, Dec 11 2019