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.

A009995 Numbers with digits in strictly decreasing order. From the Macaulay expansion of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 210, 310, 320, 321, 410, 420, 421, 430, 431, 432, 510, 520, 521, 530
Offset: 1

Views

Author

Keywords

Comments

There are precisely 1023 terms (corresponding to every nonempty subset of {0..9}).
A178788(a(n)) = 1. - Reinhard Zumkeller, Jun 30 2010
A193581(a(n)) > 0 for n > 9. - Reinhard Zumkeller, Aug 10 2011
A227362(a(n)) = a(n). - Reinhard Zumkeller, Jul 09 2013
For a fixed natural number r, any natural number n has a unique "Macaulay expansion" n = C(a_r,r)+C(a_{r-1},r-1)+...+C(a_1,1) with a_r > a_{r-1} > ... > a_1 >= 0. If r=10, concatenating the digits a_r, ..., a_1 gives the present sequence. The representation is valid for all n, but the concatenation only makes sense if all the a_i are < 10. - N. J. A. Sloane, Apr 05 2014
a(n) = A262557(A263327(n)); a(A263328(n)) = A262557(n). - Reinhard Zumkeller, Oct 15 2015

Crossrefs

Cf. A009993.
Cf. A262557 (sorted lexicographically), A263327, A263328.

Programs

  • Haskell
    import Data.Set (fromList, minView, insert)
    a009995 n = a009995_list !! n
    a009995_list = 0 : f (fromList [1..9]) where
       f s = case minView s of
             Nothing     -> []
             Just (m,s') -> m : f (foldl (flip insert) s' $
                                  map (10*m +) [0..m `mod` 10 - 1])
    -- Reinhard Zumkeller, Aug 10 2011
    
  • Mathematica
    Sort@ Flatten@ Table[FromDigits /@ Subsets[ Range[9, 0, -1], {n}], {n, 10}] (* Zak Seidov, May 10 2006 *)
  • PARI
    is(n)=fromdigits(vecsort(digits(n),,12))==n \\ Charles R Greathouse IV, Apr 16 2015