login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A329725
a(1)=0, a(n) = n - (product of nonzero digits of n) - a(n-1).
1
0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 17, 2, 16, 1, 15, 0, 14, -1, 13, -2, 29, -1, 27, -3, 25, -5, 23, -7, 21, -9, 45, -8, 42, -11, 39, -14, 36, -17, 33, -20, 65, -19, 61, -23, 57, -27, 53, -31, 49, -35, 89, -34, 84, -39, 79, -44, 74, -49, 69, -54, 117
OFFSET
1,10
COMMENTS
a(10n+1)-a(10n-1)=1 for all positive integer n (conjectured).
LINKS
FORMULA
a(n) = Sum_{k=2..n} (-1)^(n-k)*A063543(k). - Robert Israel, Nov 20 2019
EXAMPLE
a(22) = 22 - 2*2 - 2 = 16.
MAPLE
R:= ListTools:-PartialSums(map(n -> (-1)^n*(n - convert(subs(0=NULL, convert(n, base, 10)), `*`)), [$1..100])):
seq((-1)^n*R[n], n=1..100); # Robert Israel, Nov 20 2019
MATHEMATICA
Nest[Append[#1, #2 - Last[#1] - Times @@ DeleteCases[IntegerDigits[#2], 0]] & @@ {#, Length@ # + 1} &, {0}, 69] (* Michael De Vlieger, Nov 19 2019 *)
PROG
(PARI) for (n=1, 70, print1 (v=if (n==1, 0, n - vecprod(select(sign, digits(n))) - v)", ")) \\ Rémy Sigrist, Nov 28 2019
CROSSREFS
Sequence in context: A209050 A010690 A224835 * A339354 A280375 A067617
KEYWORD
sign,base,look
AUTHOR
Joshua Oliver, Nov 19 2019
STATUS
approved