A109662 Numbers k such that the sum of the digits of (k^k - k!) is divisible by k.
1, 2, 3, 9, 14, 15, 29, 33, 45, 81, 102, 105, 126, 142, 157, 288, 414, 1184, 2133, 10449, 16369, 17221, 46524, 214179, 216741
Offset: 1
Examples
The digits of 414^414 - 414! sum to 4968 and 4968 is divisible by 414, so 414 is in the sequence.
Programs
-
Mathematica
Do[s = n^n - n!; k = Plus @@ IntegerDigits[s]; If[Mod[k, n] == 0, Print[n]], {n, 1, 10000}]
Extensions
Terms a(20)-a(25) from Lars Blomberg, Jul 05 2011
Comments