The numbers 12, 63 and 119 have something in common related with their divisors and their prime factors, let's see it.
```
Numbers PrimeFactorsSum(pfs)        DivisorsSum(ds)              Is ds divisible by pfs
12         2 + 2 + 3 = 7         1 + 2 + 3 + 4 + 6 + 12 = 28            28 / 7 = 4,  Yes
63         3 + 3 + 7 = 13        1 + 3 + 7 + 9 + 21 + 63 = 104         104 / 13 = 8, Yes
119        7 + 17 = 24           1 + 7 + 17 + 119 = 144                144 / 24 = 6, Yes
```
There is an obvius property you can see: the sum of the divisors of a number is divisible by the sum of its prime factors.

We need the function ```ds_multof_pfs()``` that receives two arguments: ```nMin``` and  ```nMax```, as a lower and upper limit (inclusives), respectively, and outputs a sorted list with the numbers that fulfill the property described above.

We represent the features of the described function:
```python
ds_multof_pfs(nMin, nMax) -----> [n1, n2, ....., nl] # nMin ≤ n1 < n2 < ..< nl ≤ nMax
```
Let's see some cases:
```python
ds_multof_pfs(10, 100) == [12, 15, 35, 42, 60, 63, 66, 68, 84, 90, 95]

ds_multof_pfs(20, 120) == [35, 42, 60, 63, 66, 68, 84, 90, 95, 110, 114, 119]
```
Enjoy it!!

Source: codewars | Difficulty: EASY
Tags: Mathematics

Starter code: def ds_multof_pfs(n_min, n_max):
	

Solutions:
from bisect import bisect_left
a = [12, 15, 35, 42, 60, 63, 66, 68, 84, 90, 95, 110, 114, 119, 140, 143, 152, 168, 189, 195, 204, 209, 216, 234, 245, 258, 264, 270, 280, 287, 290, 294, 297, 319, 322, 323, 352, 368, 377, 380, 384, 396, 470, 476, 480, 506, 510, 527, 531, 544, 552, 558, 559, 572, 588, 616, 621, 693, 702, 741, 744, 756, 760, 779, 812, 819, 825, 837, 855, 880, 899, 902, 923, 940, 950, 952, 989, 990, 1007, 1010, 1026, 1044, 1056, 1064, 1078, 1080, 1102, 1144, 1170, 1188, 1189, 1197, 1199, 1280, 1288, 1292, 1298, 1334, 1343, 1349, 1365, 1372, 1375, 1386, 1392, 1440, 1456, 1470, 1494, 1566, 1595, 1620, 1625, 1638, 1652, 1672, 1696, 1700, 1704, 1750, 1763, 1768, 1785, 1804, 1836, 1840, 1845, 1887, 1908, 1914, 1917, 1919, 1944, 1950, 1980, 1989, 1998, 2024, 2052, 2060, 2070, 2075, 2080, 2107, 2130, 2145, 2158, 2159, 2162, 2208, 2240, 2242, 2272, 2340, 2392, 2448, 2464, 2496, 2507, 2520, 2541, 2632, 2660, 2668, 2673, 2688, 2691, 2728, 2759, 2772, 2784, 2805, 2808, 2828, 2835, 2842, 2882, 2911, 2970, 2992, 3000, 3002, 3015, 3026, 3069, 3072, 3078, 3096, 3132, 3159, 3160, 3168, 3239, 3266, 3300, 3304, 3366, 3375, 3402, 3422, 3471, 3485, 3496, 3500, 3560, 3572, 3596, 3599, 3624, 3652, 3690, 3705, 3720, 3752, 3773, 3784, 3816, 3818, 3827, 3840, 3852, 3933, 3936, 3952, 3990, 4018, 4031, 4060, 4077, 4116, 4128, 4136, 4165, 4182, 4216, 4256, 4264, 4292, 4305, 4320, 4368, 4389, 4410, 4437, 4446, 4522, 4524, 4557, 4592, 4607, 4625, 4644, 4648, 4653, 4655, 4662, 4680, 4704, 4706, 4719, 4720, 4731, 4736, 4750, 4785, 4806, 4810, 4860, 4864, 4872, 4992, 4998, 5005, 5015, 5032, 5040, 5070, 5076, 5125, 5166, 5175, 5183, 5200, 5207, 5225, 5229, 5249, 5264, 5307, 5310, 5346, 5400, 5424, 5434, 5452, 5459, 5460, 5472, 5508, 5543, 5544, 5546, 5560, 5586, 5590, 5664, 5698, 5704, 5720, 5728, 5775, 5800, 5848, 5850, 5865, 5886, 5950, 5992, 6000, 6006, 6018, 6039, 6095, 6150, 6156, 6160, 6171, 6250, 6256, 6270, 6424, 6439, 6460, 6510, 6517, 6528, 6565, 6579, 6580, 6600, 6624, 6656, 6660, 6688, 6725, 6750, 6776, 6802, 6804, 6806, 6816, 6837, 6840, 6860, 6887, 6903, 6909, 6944, 6952, 6960, 7007, 7038, 7040, 7050, 7052, 7067, 7140, 7144, 7150, 7176, 7210, 7236, 7254, 7279, 7314, 7336, 7384, 7395, 7410, 7425, 7426, 7462, 7506, 7524, 7532, 7544, 7568, 7581, 7616, 7668, 7682, 7700, 7701, 7722, 7735, 7739, 7742, 7750, 7752, 7821, 7830, 7872, 7878, 7888, 7904, 7912, 7964, 8140, 8159, 8225, 8232, 8280, 8330, 8349, 8352, 8379, 8385, 8397, 8415, 8470, 8500, 8528, 8568, 8575, 8580, 8639, 8642, 8673, 8692, 8721, 8745, 8786, 8800, 8829, 8832, 8856, 8874, 8960, 8964, 8991, 8993, 9063, 9064, 9088, 9112, 9164, 9179, 9180, 9218, 9240, 9256, 9282, 9308, 9310, 9328, 9352, 9375, 9432, 9460, 9468, 9504, 9537, 9593, 9633, 9639, 9660, 9701, 9720, 9768, 9794, 9799, 9856, 9869, 9870, 9900, 9911, 9912, 9920, 9933, 9936, 9947, 9956, 9963, 9996, 10005, 10064, 10080, 10120, 10150, 10185, 10200, 10207, 10240, 10283, 10296, 10395, 10403, 10465, 10494, 10502, 10508, 10528, 10545, 10582, 10647, 10660, 10664, 10672, 10763, 10792, 10848, 10864, 10877, 10880, 10989, 11050, 11088, 11109, 11125, 11128, 11132, 11151, 11160, 11172, 11176, 11193, 11214, 11223, 11224, 11253, 11266, 11275, 11305, 11340, 11342, 11408, 11417, 11439, 11468, 11475, 11500, 11505, 11556, 11560, 11613, 11648, 11659, 11662, 11663, 11682, 11750, 11774, 11800, 11844, 11865, 11904, 11970, 11979, 11985, 12000, 12006, 12095, 12098, 12136, 12141, 12180, 12208, 12222, 12240, 12276, 12319, 12328, 12360, 12366, 12397, 12412, 12441, 12460, 12474, 12519, 12524, 12540, 12555, 12558, 12561, 12576, 12580, 12628, 12638, 12712, 12740, 12784, 12792, 12851, 12903, 12960, 12975, 12992, 13056, 13068, 13144, 13199, 13209, 13230, 13260, 13280, 13300, 13332, 13439, 13464, 13500, 13509, 13529, 13536, 13566, 13572, 13585, 13608, 13629, 13653, 13662, 13677, 13702, 13716, 13720, 13750, 13761, 13770, 13826, 13840, 13862, 13869, 13912, 13919, 14098, 14100, 14104, 14105, 14144, 14145, 14190, 14195, 14250, 14256, 14259, 14260, 14299, 14326, 14344, 14382, 14396, 14402, 14504, 14514, 14520, 14616, 14632, 14645, 14685, 14688, 14690, 14700, 14732, 14749, 14824, 14850, 14875, 14940, 14950, 14972, 14973, 14994, 15008, 15050, 15066, 15088, 15105, 15210, 15249, 15250, 15272, 15288, 15435, 15480, 15503, 15539, 15540, 15544, 15582, 15602, 15631, 15664, 15698, 15708, 15730, 15732, 15785, 15870, 15873, 15878, 15912, 15930, 15960]

def ds_multof_pfs(n, m):
	return a[bisect_left(a, n):bisect_left(a, m + 1)]


import operator as op
from functools import reduce

def memoize(func):
	cache = {}

	def newfunc(*args):
		if args not in cache:
			cache[args] = func(*args)
		return cache[args]
	return newfunc

@memoize
def factors_of(n):
	result = []
	i = 2
	while i <= n:
		if n % i == 0:
			multiplicity = 0
			while n % i == 0:
				n = n / i
				multiplicity += 1
			result.append((i, multiplicity))
		i += 1
	return result

def filter_func(n):
	factors = factors_of(n)
	pfs = sum((p * i for (p, i) in factors))
	ds = reduce(op.mul, ((p ** (i + 1) - 1) / (p - 1) for (p, i) in factors))
	return ds % pfs == 0

def ds_multof_pfs(nMin, nMax):
	return list(filter(filter_func, range(nMin, nMax + 1)))[:]


from functools import lru_cache as LC
FC = lambda n, li=[], j=2: (FC(n, li, j + 1) if n % j else FC(n // j, li + [j], j)) if j * j <= n else sum(li + [[], [n]][n > 1])
GF = LC(None)(lambda n: FC(n))
GD = LC(None)(lambda n: sum(sum([[i, n // i] for i in range(1, int(n ** 0.5) + 1) if not n % i], [])))
ds_multof_pfs = lambda start, end: [i for i in range(start, end + 1) if not GD(i) % GF(i)]


a = [1] * 20000
a[0] = a[1] = 0
for i in range(2, 20000):
	if a[i]:
		for j in range(i ** 2, 20000, i):
			a[j] = 0
a = [i for (i, x) in enumerate(a) if x]

def ds_multof_pfs(a, b):
	return [i for i in range(a, b + 1) if not divisors(i) % primes(i)]

def divisors(n):
	r = 0
	for i in range(1, int(n ** 0.5) + 1):
		if not n % i:
			r += i
			if i * i != n:
				r += n // i
	return r

def primes(n):
	r = 0
	for x in a:
		while not n % x:
			r += x
			n //= x
		if n == 1:
			return r


import math

def PrimeFactorsSum(nr):
	res = []
	s = 1
	for i in range(2, int(math.sqrt(nr) + 1)):
		cs = 1
		ct = 1
		while nr % i == 0:
			res.append(i)
			nr //= i
			ct *= i
			cs += ct
		s *= cs
	if nr > 2:
		s *= nr + 1
		res.append(nr)
	if res and s % sum(res) == 0:
		return True
	return False

def ds_multof_pfs(nMin, nMax):
	res = []
	i = nMin
	while i <= nMax:
		if PrimeFactorsSum(i):
			res.append(i)
		i += 1
	return res


from functools import lru_cache
FC = lambda n, li=[], j=2: (FC(n, li, j + 1) if n % j else FC(n // j, li + [j], j)) if j * j <= n else sum(li + [[], [n]][n > 1])
get_factors = lru_cache(None)(lambda n: FC(n))
get_divisors = lru_cache(None)(lambda n: sum(sum([[i, n // i] for i in range(1, int(n ** 0.5) + 1) if not n % i], [])))
ds_multof_pfs = lambda start, end: [i for i in range(start, end + 1) if not get_divisors(i) % get_factors(i)]