A249121 a(n) = n - (sum of digits of n) - (product of digits of n).
0, -1, -2, -3, -4, -5, -6, -7, -8, -9, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0, 36, 32, 28, 24, 20, 16, 12, 8, 4, 0, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0, 54, 48, 42, 36, 30, 24, 18, 12, 6, 0, 63, 56, 49, 42, 35, 28, 21, 14, 7, 0, 72, 64, 56
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- Zak Seidov, Color graph with line connecting the consecutive points.
Programs
-
Maple
a:= n-> (l-> n-add(i, i=l)-mul(i, i=l))(convert(n, base, 10)): seq(a(n), n=0..120); # Alois P. Heinz, Oct 22 2014
-
Mathematica
Table[id = IntegerDigits[n]; n - (Plus @@ id) - (Times @@ id), {n, 0, 200}]
-
PARI
a(n)=d=digits(n);if(!n,return(0));n-sumdigits(n)-prod(i=1,#d,d[i]) vector(100,n,a(n-1)) \\ Derek Orr, Oct 21 2014
Comments