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.

A029740 Odd numbers with distinct digits.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 103, 105, 107, 109, 123, 125, 127, 129, 135, 137, 139, 143, 145, 147, 149, 153, 157
Offset: 1

Views

Author

Keywords

Comments

The sequence has 4384045 terms. - Harvey P. Dale, Jan 12 2019
Maximum term is 9876543201. Next higher number with distinct digits is 9876543210. - Alonso del Arte, Jan 09 2020

Crossrefs

Cf. A029741 (even version). Union of that sequence with this sequence gives A010784.

Programs

  • Mathematica
    Select[Range[1, 199, 2], Max[DigitCount[#]] == 1 &] (* Harvey P. Dale, Jan 12 2019 *)
  • Python
    # generates full sequence
    from itertools import permutations
    afull = sorted(set(int("".join(p)) for d in range(1, 11) for p in permutations("0123456789", d) if p[0] != "0" and p[-1] in "13579"))
    print(afull[:100]) # Michael S. Branicky, Aug 04 2022
  • Scala
    def hasDistinctDigits(n: Int): Boolean = {
      val numerStr = n.toString
      val digitSet = numerStr.split("").toSet
      numerStr.length == digitSet.size
    }
    (1 to 199 by 2).filter(hasDistinctDigits) // Alonso del Arte, Jan 09 2020
    

Extensions

First comment corrected by Harvey P. Dale, Mar 04 2020 at the insistence of Sean A. Irvine
Offset changed to 1 by Michael S. Branicky, Aug 04 2022
Removed incorrect Sage program. - N. J. A. Sloane, Aug 04 2022