login
Product of (digits of n each incremented by 1).
7

%I #91 Feb 01 2023 12:27:56

%S 1,2,3,4,5,6,7,8,9,10,2,4,6,8,10,12,14,16,18,20,3,6,9,12,15,18,21,24,

%T 27,30,4,8,12,16,20,24,28,32,36,40,5,10,15,20,25,30,35,40,45,50,6,12,

%U 18,24,30,36,42,48,54,60,7,14,21,28,35,42,49,56,63,70,8,16,24,32,40,48,56,64

%N Product of (digits of n each incremented by 1).

%C Sum of products of all subsets of digits of n (with the empty subset contributing 1).

%C Number of nonnegative values k such that the lunar sum of k and n is n.

%C First 100 values are 10 X 10 multiplication table, read by rows/columns.

%H Reinhard Zumkeller, <a href="/A089898/b089898.txt">Table of n, a(n) for n = 0..10000</a>

%H D. Applegate, M. LeBrun and N. J. A. Sloane, <a href="http://arxiv.org/abs/1107.1130">Dismal Arithmetic</a>, arXiv:1107.1130 [math.NT], 2011. [Note: we have now changed the name from "dismal arithmetic" to "lunar arithmetic" - the old name was too depressing]

%F a(n) = a(floor(n/10))*(1+(n mod 10)). - _Robert Israel_, Nov 17 2014

%F G.f. g(x) satisfies g(x) = (10*x^11 - 11*x^10 + 1)*g(x^10)/(x-1)^2. - _Robert Israel_, Nov 17 2014

%e a(12)=6 since (1+1)*(2+1)=2*3=6 and since (1*2)+(1)+(2)+(1)=2+1+2+1=6 and since the lunar sum of 12 with any of the six values {0,1,2,10,11,12} is 12.

%p seq(convert(map(`+`,convert(n,base,10),1),`*`), n = 0 .. 1000); # _Robert Israel_, Nov 17 2014

%t a089898[n_Integer] :=

%t Prepend[Array[Times @@ (IntegerDigits[#] + 1) &, n], 1]; a089898[77] (* _Michael De Vlieger_, Dec 22 2014 *)

%o (PARI) a(n) = my(d=digits(n)); prod(i=1, #d, d[i]+1); \\ _Michel Marcus_, Apr 06 2014

%o (PARI) a(n) = vecprod(apply(x->x+1, digits(n))); \\ _Michel Marcus_, Feb 01 2023

%o (Haskell)

%o a089898 n = if n < 10 then n + 1 else (d + 1) * a089898 n'

%o where (n', d) = divMod n 10

%o -- _Reinhard Zumkeller_, Jul 06 2014

%Y Cf. A007954, A087061, A001316, A006047.

%K base,easy,nonn,look

%O 0,2

%A _Marc LeBrun_, Nov 13 2003