|
|
A133598
|
|
Numbers k with all digits distinct and nonzero, such that none of k's digits divide k, but all the nonzero digits not in k do divide k.
|
|
2
|
|
|
5936, 45798, 45978, 47598, 47958, 49578, 49758, 54798, 57894, 58794, 58974, 59478, 59836, 59874, 74598, 74958, 75498, 78594, 78954, 79458, 79854, 85794, 87594, 87954, 89574, 94578, 94758, 95478, 95874, 97458, 97854, 98754, 346598, 358694
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
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
|
|
|
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)
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,fini,full
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|