OFFSET
0,2
COMMENTS
Sum of products of all subsets of digits of n (with the empty subset contributing 1).
Number of nonnegative values k such that the lunar sum of k and n is n.
First 100 values are 10 X 10 multiplication table, read by rows/columns.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
D. Applegate, M. LeBrun and N. J. A. Sloane, Dismal Arithmetic, 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]
FORMULA
a(n) = a(floor(n/10))*(1+(n mod 10)). - Robert Israel, Nov 17 2014
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
EXAMPLE
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.
MAPLE
seq(convert(map(`+`, convert(n, base, 10), 1), `*`), n = 0 .. 1000); # Robert Israel, Nov 17 2014
MATHEMATICA
a089898[n_Integer] :=
Prepend[Array[Times @@ (IntegerDigits[#] + 1) &, n], 1]; a089898[77] (* Michael De Vlieger, Dec 22 2014 *)
PROG
(PARI) a(n) = my(d=digits(n)); prod(i=1, #d, d[i]+1); \\ Michel Marcus, Apr 06 2014
(PARI) a(n) = vecprod(apply(x->x+1, digits(n))); \\ Michel Marcus, Feb 01 2023
(Haskell)
a089898 n = if n < 10 then n + 1 else (d + 1) * a089898 n'
where (n', d) = divMod n 10
-- Reinhard Zumkeller, Jul 06 2014
CROSSREFS
KEYWORD
AUTHOR
Marc LeBrun, Nov 13 2003
STATUS
approved