OFFSET
1,2
COMMENTS
a(n) = -1 if and only if the digits of n does not contain 0 but contains 5 and one or more nonzero even number.
Conjecture: a(709) = 707777779779 is the largest a(n) for all n.
Conjecture is true, via exhaustive testing of all subsets of decimal digits. Indeed, the cardinality of the range is 783 (including -1; see a-file for values). - Michael S. Branicky, Nov 19 2025
LINKS
Michael S. Branicky, Table of k, a(k) for set of k covering all nonempty subsets of decimal digits - {0}.
Shouen Wang, a(n) has the same digits as n and is divisible by each digit (Chinese).
FORMULA
a(n) = a(A137564(n)). - Michael S. Branicky, Nov 19 2025
EXAMPLE
a(13) = a(31) = 1113 because 1113 is the least integer composed with 1's and 3's that is divisible by both 1 and 3.
MATHEMATICA
a[n_] := (d = Union@IntegerDigits[n]; lcm = LCM @@ Select[d, Positive];
If[d[[1]] > 0 && Divisible[lcm, 10], Return[-1]];
l = Length[d]; Do[f = Join @@ Table[d, j];
v = FromDigits /@
Union@Select[Permutations[f, {j}], #[[1]] > 0 && Union@# == d &];
For[k = 1, k <= Length@v, k++,
If[Mod[v[[k]], lcm] == 0, Return[v[[k]]]]], {j, l, 20}]);
Table[a[n], {n, 60}]
PROG
(Python)
import math
from itertools import product
from functools import reduce
def lcm(a, b):
return abs(a * b) // math.gcd(a, b) if a and b else 0
def a(n):
d = [int(x) for x in sorted(set(str(n)))]
non_zero = [x for x in d if x > 0]
lc=reduce(lcm, non_zero)
if not non_zero or (d[0] > 0 and lc % 10 == 0):
return -1
for j in range(len(d), 21):
for perm in product(d, repeat=j):
if perm[0] > 0 and set(perm) == set(d):
num = int(''.join(map(str, perm)))
if num % lc == 0:
return num
print( [a(n) for n in range(1, 61)])
CROSSREFS
KEYWORD
sign,base
AUTHOR
Zhining Yang, Nov 17 2025
STATUS
approved
