OFFSET
0,3
COMMENTS
This sequence is the building block for the calculation of the sums of positive integers whose decimal notation uses seven distinct, nonzero digits: see the attached pdf document.
LINKS
Pierre-Alain Sallard, Table of n, a(n) for n = 0..50
Pierre-Alain Sallard, Integers sequences A328348 and A328350 to A328356
Index entries for linear recurrences with constant coefficients, signature (78,-567,490).
FORMULA
a(n) = (60*70^n-69*7^n+9) / 3726.
a(n) = 71*a(n-1) - 70*a(n-2) + 7^(n-1) for n > 1.
G.f.: x / (1 - 78*x + 567*x^2 - 490*x^3).
a(n) = 78*a(n-1) - 567*a(n-2) + 490*a(n-3) for n > 2.
EXAMPLE
For n=2, the sum of all positive integers whose decimal notation is made of, let's say, the 3,4,5,6,7,8 and 9 digits with at most n=2 such digits, i.e., the sum 3+4+5+6+7+8+9+33+34+35+36+37+38+39+43+44+45+46+47+48+49+53+54+55+56+57+58+59+63+64+65+66+67+68+69+73+74+75+76+78+79+83+84+85+86+87+88+89+93+94+95+96+97+98+99, is equal to a(2)*(3+4+5+6+7+8+9) = 78*42 = 3276.
MATHEMATICA
LinearRecurrence[{78, -567, 490}, {0, 1, 78}, 20] (* Harvey P. Dale, Jan 30 2024 *)
PROG
(Python) [(60*70**n-69*7**n+9)//3726 for n in range(20)]
(PARI) concat(0, Vec(x / ((1 - x)*(1 - 7*x)*(1 - 70*x)) + O(x^17))) \\ Colin Barker, Dec 06 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Pierre-Alain Sallard, Nov 26 2019
STATUS
approved