login
A165209
Numbers whose digital sum is divisible by the digital sum of its divisors.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17, 19, 22, 23, 26, 27, 29, 31, 33, 37, 39, 41, 43, 44, 46, 47, 53, 55, 59, 61, 62, 66, 67, 69, 71, 73, 77, 79, 81, 82, 83, 86, 88, 89, 93, 97, 99, 101, 103, 107, 109, 113, 121, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173
OFFSET
1,2
COMMENTS
All primes are terms of this sequence.
Nonprime terms begin 1, 4, 6, 8, 9, 22, 26, 27, ...
This sequence deviates from A072227; they first differ at n=40: a(40) = 81 while A072227(40) = 82. Each of the first 65 terms of A072227 is a term of this sequence. Sequence of different terms: 81, ..., ?
A072227 is not a subsequence; A072227(256) = 1089 and 363 divides 1089 but 3+6+3 does not divide 1+0+8+9. - Charles R Greathouse IV, Sep 12 2012
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(40) = 81, the divisors of 81 are 1, 3, 9, 27, 81, with digital sums 1, 3, 9, 9, 9 which all divide the digital sum of 81, i.e., 9.
MATHEMATICA
dsdQ[n_]:=Module[{dsn=Total[IntegerDigits[n]], dsd=Total[ IntegerDigits[ #]]&/@ Divisors[n]}, And@@Divisible[dsn, dsd]]; Select[Range[200], dsdQ] (* Harvey P. Dale, Aug 11 2014 *)
PROG
(PARI) dsum(n)=my(s); while(n, s+=n%10; n\=10); s
is(n)=my(t=dsum(n)); fordiv(n, d, if(t%dsum(d), return(0))); 1 \\ Charles R Greathouse IV, Sep 12 2012
(Python)
from sympy import divisors
def ds(n): return sum(map(int, str(n)))
def ok(n):
dsn = ds(n)
return all(dsn%ds(d) == 0 for d in divisors(n, generator=True))
print([k for k in range(1, 174) if ok(k)]) # Michael S. Branicky, Jun 25 2022
CROSSREFS
Cf. A072227.
Sequence in context: A225657 A175772 A124868 * A072227 A122427 A161597
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Sep 07 2009
STATUS
approved