A247227 Numbers that divide the sum of the factorials of their digits in base 10.
1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 56, 71, 93, 145, 219, 758, 768, 7584, 7684, 9696, 10081, 21993, 40585
Offset: 1
Examples
19 is in the sequence because 19 divides 1! + 9! = 1 + 362880 = 362881; 362881 / 19 = 19099.
Programs
-
Magma
[n: n in [1..2000000] | &+[ Factorial(d): d in Intseq(n)] mod n eq 0]
-
Mathematica
Select[Range[50000], Mod[Plus @@ Factorial[IntegerDigits[#]], #] == 0 &] (* Michael De Vlieger, Dec 26 2014 *)
-
PARI
for(k=1,10^5,d=digits(k);s=sum(i=1,#d,d[i]!);if(!(s%k),print1(k,", "))) \\ Derek Orr, Dec 30 2014
Comments