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.

A230959 If n is pandigital then 0 else (digits not occurring in decimal representation of n, arranged in decreasing order).

Original entry on oeis.org

987654321, 987654320, 987654310, 987654210, 987653210, 987643210, 987543210, 986543210, 976543210, 876543210, 98765432, 987654320, 98765430, 98765420, 98765320, 98764320, 98754320, 98654320, 97654320, 87654320, 98765431, 98765430, 987654310, 98765410
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 02 2013

Keywords

Comments

a(0) > a(n) for n > 0;
a(A171102(n)) = 0 by definition, but also a(A050289(n)) = 0.

Crossrefs

Cf. A227362.

Programs

  • Haskell
    import Data.List ((\\))
    a230959 n = (if null cds then 0 else read cds) :: Integer
       where cds = "9876543210" \\ show n
    
  • Mathematica
    pd[n_]:=Module[{idn=Sort[IntegerDigits[n]]},If[idn==Range[0,9],0,FromDigits[ Reverse[ Complement[ Range[ 0,9],idn]]]]]; Table[pd[n],{n,0,30}] (* Harvey P. Dale, Nov 16 2023 *)
  • Python
    def A230959(n): return int(''.join(sorted(set('9876543210')-set(str(n)),reverse=True)) or 0) # Chai Wah Wu, Nov 23 2022