A092911 Numbers all of whose divisors can be formed using their digits. Divisor digits are a subset of the digits of the number.
1, 11, 13, 17, 19, 31, 41, 61, 71, 101, 103, 107, 109, 113, 121, 125, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 241, 251, 271, 281, 311, 313, 317, 331, 401, 419, 421, 431, 461, 491, 521, 541, 571
Offset: 1
Examples
131 is a term. 143 is not a term as the divisor 11 contains two 1's.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isA092911 := proc(n) local digs, digsleft,divs, d,i,j ; digs := convert(n,base,10) ; divs := numtheory[divisors](n) ; for i from 1 to nops(divs) do digsleft := digs ; d := convert(op(i,divs),base,10) ; for j in d do if member(j,digsleft,'jposit') then digsleft := subsop(jposit=NULL,digsleft) ; else RETURN(false) ; fi ; od ; od ; RETURN(true) ; end: for n from 1 to 600 do if isA092911(n) then printf("%d, ",n) ; fi ; od ; # R. J. Mathar, Jul 26 2007
-
Mathematica
subQ[s1_, s2_] := AllTrue[Count[s1, #] & /@ (First /@ (t = Tally[s2])) - Last /@ t, # >= 0 &]; digQ[n1_, n2_] := subQ[IntegerDigits[n1], IntegerDigits[n2]]; seqQ[n_] := AllTrue[Most@Divisors[n], digQ[n, #] &]; Select[Range[600], seqQ] (* Amiram Eldar, Nov 12 2020 *)
-
Python
from sympy import divisors from collections import Counter def ok(n): ncounts = Counter(str(n)) for d in divisors(n)[:-1]: divcounts = Counter(str(d)) if any(ncounts[c] < divcounts[c] for c in divcounts): return False return True print(list(filter(ok, range(1, 630)))) # Michael S. Branicky, May 08 2021
Extensions
Corrected and extended by R. J. Mathar, Jul 26 2007
Comments