login
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.
1

%I #23 Sep 11 2024 22:53:58

%S 100269,100479,101269,101479,102269,102669,102699,104479,104779,

%T 104799,200589,202589,205589,205889,205899,300789,303789,307789,

%U 307889,307899,1000269,1000479,1001269,1001479,1002269,1002349,1002359,1002369,1002379,1002469,1002479,1002489,1002569,1002579

%N 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.

%C Anagrams of the terms are not included in the sequence.

%C There are 320 such numbers up to 10^7, the largest being 5067899.

%H David A. Corneth, <a href="/A365375/b365375.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 100269 and we have:

%e 0 = 0 - 0

%e 1 = 1 - 0

%e 2 = 2 - 0

%e 3 = 9 - 6

%e 4 = 6 - 2

%e 5 = 6 - 1

%e 6 = 6 - 0

%e 7 = 9 - 2

%e 8 = 9 - 1

%e 9 = 9 - 0

%e The integer 102069 being an anagram of 100269 is not in the sequence (though 102069 also produces the 10 digits).

%t 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}]

%o (Python)

%o from itertools import count, islice, combinations, combinations_with_replacement as mc

%o def c(t):

%o d = list(map(int, t))

%o return len(set(abs(d[i]-d[j]) for i, j in combinations(range(len(d)), 2))) == 10

%o def bgen():

%o D = "123456789"

%o return ((D[i],)+r for d in count(1) for i in range(9) for r in mc("0"+D[i:], d-1))

%o def agen():

%o yield from (int("".join(t)) for t in filter(c, cgen()))

%o print(list(islice(agen(), 34))) # _Michael S. Branicky_, Sep 11 2024

%Y Cf. A179239, A219248.

%K base,nonn

%O 1,1

%A _Eric Angelini_ and _Giorgos Kalogeropoulos_, Sep 02 2023

%E Name specified by _David A. Corneth_, Sep 11 2024