OFFSET
1,1
COMMENTS
Anagrams of the terms are not included in the sequence.
There are 320 such numbers up to 10^7, the largest being 5067899.
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
EXAMPLE
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).
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}]
PROG
(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, cgen()))
print(list(islice(agen(), 34))) # Michael S. Branicky, Sep 11 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Giorgos Kalogeropoulos, Sep 02 2023
EXTENSIONS
Name specified by David A. Corneth, Sep 11 2024
STATUS
approved