OFFSET
0,3
COMMENTS
This sequence is the building block for the calculation of the sums of positive integers whose decimal expansion only uses five 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 (56, -305, 250).
FORMULA
a(n) = (40*50^n - 49*5^n + 9) / 1764.
a(n) = 51*a(n-1) - 50*a(n-2) + 5^(n-1) for n > 1.
G.f.: x / (1 - 56*x + 305*x^2 - 250*x^3).
a(n) = 56*a(n-1) - 305*a(n-2) + 250*a(n-3) for n > 2.
EXAMPLE
For n=2, the sum of all positive integers whose decimal notation is only made of the 3,4,5,6 and 7 digit with at most n=2 such digits, i.e. the sum 3+4+5+6+7+33+34+35+36+37+43+44+45+46+47+53+54+55+56+57+63+64+65+66+67+73+74+75+76+77 is equal to a(2)*(3+4+5+6+7) = 56*25 = 1400.
The formula is valid for any other 5-tuple of digits, as soon as the 5 digits are different from each other. Always with n=2 but let's say with the 5,6,7,8 and 9 digits, the sum 5+6+7+8+9+55+56+57+58+59+65+66+67+68+69+75+76+77+78+79+85+86+87+88+89+95+96+97+98+99 is equal to a(2)*(5+6+7+8+9) = 56*35 = 1960.
PROG
(Python) [(40*50**n-49*5**n+9)//1764 for n in range(12)]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pierre-Alain Sallard, Nov 26 2019
STATUS
approved