A108911 Difference between n and the sum of the factorials of its digits.
0, 0, -3, -20, -115, -714, -5033, -40312, -362871, 8, 9, 9, 6, -11, -106, -705, -5024, -40303, -362862, 17, 18, 18, 15, -2, -97, -696, -5015, -40294, -362853, 23, 24, 24, 21, 4, -91, -690, -5009, -40288, -362847, 15, 16, 16, 13, -4, -99, -698, -5017, -40296, -362855, -71, -70, -70, -73
Offset: 1
Examples
For n = 35, a(35) = -91 because 35 - (3! + 5!) = 35 - (6 + 120) = -91.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Programs
-
Magma
[n-&+[Factorial(d): d in Intseq(n)]: n in [1..60]]; // Bruno Berselli, Oct 25 2018
-
Maple
a:= n-> n-add(i!, i=convert(n, base, 10)): seq(a(n), n=1..100); # Alois P. Heinz, Oct 24 2018
-
Mathematica
f[n_] := n - Plus @@ Factorial /@ IntegerDigits[n]; Table[f[n], {n, 53}] (* Ray Chandler, Jul 24 2005 *)
-
PARI
a(n) = my(d = digits(n)); n - sum(i=1, #d, d[i]!); \\ Michel Marcus, Apr 21 2014
Formula
a(n) = n - (N0! + N1! + N2! + ...) if n = N0*10^0 + N1*10^1 + N2*10^2 ...
a(n) = n - A061602(n). - Michel Marcus, Apr 21 2014
Extensions
Extended by Ray Chandler, Jul 24 2005
Comments