OFFSET
1,1
COMMENTS
From Michael S. Branicky, Jul 06 2021: (Start)
No term contains 1 as a digit.
If 0 were allowed as a digit, then there would be 106104 terms, starting with 0, 5936, 9780, 37960, 45798 and ending with 987654203. (End)
REFERENCES
Rodolfo Kurchan, Snark, December 2007
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..13272 (terms 1..100 from Rodolfo Kurchan)
EXAMPLE
5936 is because 5936 is not divisible by 3, 5, 6 or 9 and is divisible by 1, 2, 4, 7 and 8.
MATHEMATICA
addQ[n_]:=Module[{idn=IntegerDigits[n]}, FreeQ[idn, 0]&&Max[DigitCount[ n]] == 1&&Union[Divisible[n, idn]]=={False}&&And@@Divisible[n, Complement[ Range[ 9], idn]]]; Select[Range[400000], addQ] (* Harvey P. Dale, Oct 25 2017 *)
PROG
(Python)
def ok(n):
s = str(n); ss = set(s)
return '0' not in ss and len(s) == len(ss) and all(n%int(d) for d in ss) and all(n%int(d) == 0 for d in set("123456789")-ss)
answer2 = list(filter(ok, range(N))) # Michael S. Branicky, Jul 06 2021
(Python) # generates entire sequence
from sympy.utilities.iterables import multiset_permutations
def agen():
for digits in range(1, 10):
for mp in multiset_permutations("123456789", digits):
n, mpc = int("".join(mp)), set("123456789") - set(mp)
if all(n%int(d) for d in mp) and all(n%int(d) == 0 for d in mpc):
yield n
print([an for an in agen()]) # Michael S. Branicky, Jul 06 2021
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Rodolfo Kurchan, Dec 27 2007
EXTENSIONS
Name clarified by Tanya Khovanova, Jul 06 2021
STATUS
approved