A350211 Numbers k such that the arithmetic mean of the digits of k! is an integer.
0, 1, 2, 3, 4, 5, 6, 12, 26, 28, 32, 59, 262, 391, 533, 579
Offset: 1
Examples
4 is a term because 4! = 24 and (2+4)/2 = 3 is an integer.
Programs
-
Maple
q:= n-> (f-> (add(i, i=convert(f, base, 10))/length(f))::integer)(n!): select(q, [$0..1000])[]; # Alois P. Heinz, Dec 19 2021
-
Mathematica
Do[If[IntegerQ[Mean[IntegerDigits[n!]]], Print[n, " ", Mean[IntegerDigits[n!]]]], {n, 1, 100000}]
-
PARI
isok(k) = my(d=digits(k!)); (vecsum(d) % #d) == 0; \\ Michel Marcus, Dec 19 2021
Comments