OFFSET
0,3
COMMENTS
This sequence is the building block for the calculation of the sums of positive integers whose decimal expansion uses exactly eight distinct, nonzero digits: see the attached pdf documents.
LINKS
Pierre-Alain Sallard, Integers sequences A324348 and A328350 to A328356
Index entries for linear recurrences with constant coefficients, signature (89, -728, 640).
FORMULA
a(n) = (70*80^n - 79*8^n + 9) / 4977.
a(n) = 81 a(n-1) - 80 a(n-2) + 8^(n-1) for n > 1.
G.f.: x / (1 - 89*x + 728*x^2 - 640*x^3).
a(n) = 89*a(n-1) - 728*a(n-2) + 640*a(n-3) for n > 2.
E.g.f.: (9*exp(x) - 79*exp(8*x) + 70*exp(80*x))/4977. - Stefano Spezia, Dec 11 2019
EXAMPLE
For n=2, the sum of all positive integers whose decimal notation is made of any digit different from 0 and, let's say, 9 with at most n=2 such digits, i.e., the sum 1+2+3+4+5+6+7+8+11+12+13+14+15+16+17+18+21+...+28+31+...+38+41+...+48+51+...+58+61+...+68+71+...+78+81+...+88, is equal to a(2)*(1+2+3+4+5+6+7+8) = 89*36 = 3204.
Similarly, and always with n=2, the sum of all positive integers whose decimal notation is made of any digit different from 0 and, let's say, 8, i.e., the sum 1+2+3+4+5+6+7+9+11+..+17+19+21+...+27+29+31+...+37+39+41+...+47+49+51+...+57+59+61+...+67+69+71+...+77+79+91+...+97+99 is equal to a(2)*(1+2+3+4+5+6+7+9) = 89*37 = 3293.
MATHEMATICA
CoefficientList[Series[x/(1 - 89 x + 728 x^2 - 640 x^3), {x, 0, 16}], x] (* Michael De Vlieger, Dec 10 2019 *)
PROG
(Python)[(70*80**n-79*8**n+9)//4977 for n in range(20)]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pierre-Alain Sallard, Dec 10 2019
STATUS
approved