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.

A365375 Numbers being the smallest positive integer having its digits (Cf. A179239) from which two digits can be chosen, the difference being any value from 0 to 9.

Original entry on oeis.org

100269, 100479, 101269, 101479, 102269, 102669, 102699, 104479, 104779, 104799, 200589, 202589, 205589, 205889, 205899, 300789, 303789, 307789, 307889, 307899, 1000269, 1000479, 1001269, 1001479, 1002269, 1002349, 1002359, 1002369, 1002379, 1002469, 1002479, 1002489, 1002569, 1002579
Offset: 1

Views

Author

Keywords

Comments

Anagrams of the terms are not included in the sequence.
There are 320 such numbers up to 10^7, the largest being 5067899.

Examples

			a(1) = 100269 and we have:
  0 = 0 - 0
  1 = 1 - 0
  2 = 2 - 0
  3 = 9 - 6
  4 = 6 - 2
  5 = 6 - 1
  6 = 6 - 0
  7 = 9 - 2
  8 = 9 - 1
  9 = 9 - 0
The integer 102069 being an anagram of 100269 is not in the sequence (though 102069 also produces the 10 digits).
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[If[Union@Flatten[Abs@*Differences/@Subsets[IntegerDigits@k,{2}]]==Range[0,9],If[FreeQ[lst,s=Sort@IntegerDigits@k],AppendTo[lst,s];Print@k]],{k,10^6}]
  • Python
    from itertools import count, islice, combinations, combinations_with_replacement as mc
    def c(t):
        d = list(map(int, t))
        return len(set(abs(d[i]-d[j]) for i, j in combinations(range(len(d)), 2))) == 10
    def bgen():
        D = "123456789"
        return ((D[i],)+r for d in count(1) for i in range(9) for r in mc("0"+D[i:], d-1))
    def agen():
        yield from (int("".join(t)) for t in filter(c, bgen()))
    print(list(islice(agen(), 34))) # Michael S. Branicky, Sep 11 2024

Extensions

Name specified by David A. Corneth, Sep 11 2024