login
a(n) = n - (sum of digits of n) - (product of digits of n).
2

%I #13 Jan 10 2015 19:43:54

%S 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,

%T 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,

%U 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

%N a(n) = n - (sum of digits of n) - (product of digits of n).

%C In the graph, the upper bound is the line:

%C a(10*m) = 9m: a(10) = 9, a(20) = 18, a(30) = 27,...

%H Alois P. Heinz, <a href="/A249121/b249121.txt">Table of n, a(n) for n = 0..10000</a>

%H Zak Seidov, <a href="/A249121/a249121.jpg">Color graph with line connecting the consecutive points.</a>

%F a(n) = n - A007953(n) - A007954(n) = A001477(n) - A061762(n).

%p a:= n-> (l-> n-add(i, i=l)-mul(i, i=l))(convert(n, base, 10)):

%p seq(a(n), n=0..120); # _Alois P. Heinz_, Oct 22 2014

%t Table[id = IntegerDigits[n]; n - (Plus @@ id) - (Times @@ id), {n, 0, 200}]

%o (PARI) a(n)=d=digits(n);if(!n,return(0));n-sumdigits(n)-prod(i=1,#d,d[i])

%o vector(100,n,a(n-1)) \\ _Derek Orr_, Oct 21 2014

%Y Cf. A001477, A007953, A007954, A061762.

%K sign,base,look

%O 0,3

%A _Zak Seidov_, Oct 21 2014