The output sum in your current implementation is indeed not uniformly distributed.
As an example, consider all the numbers with one or two digits (1 - 99):
1 of them is summed up to 1 ( 1)
2 of them are summed up to 2 ( 2, 20)
3 of them are summed up to 3 ( 3, 30, 21)
4 of them are summed up to 4 ( 4, 40, 31, 22)
5 of them are summed up to 5 ( 5, 50, 41, 32, 23)
6 of them are summed up to 6 ( 6, 60, 51, 42, 33, 24)
7 of them are summed up to 7 ( 7, 70, 61, 52, 43, 34, 25)
8 of them are summed up to 8 ( 8, 80, 71, 62, 53, 44, 35, 26)
9 of them are summed up to 9 ( 9, 90, 81, 72, 63, 54, 45, 36, 27)
9 of them are summed up to 10 (10, 91, 82, 73, 64, 55, 46, 37, 28)
9 of them are summed up to 11 (11, 92, 83, 74, 65, 56, 47, 38, 29)
8 of them are summed up to 12 (12, 93, 84, 75, 66, 57, 48, 39)
7 of them are summed up to 13 (13, 94, 85, 76, 67, 58, 49)
6 of them are summed up to 14 (14, 95, 86, 77, 68, 59)
5 of them are summed up to 15 (15, 96, 87, 78, 69)
4 of them are summed up to 16 (16, 97, 88, 79)
3 of them are summed up to 17 (17, 98, 89)
2 of them are summed up to 18 (18, 99)
1 of them is summed up to 19 (19)
This is probably closer to Normal Distribution than to Uniform Distribution.
In order to achieve the latter, simply return sum % c
instead of sumDigits(sum)
.