OFFSET
0,3
COMMENTS
This sequence is the building block for the calculation of the sums of positive integers whose decimal notation only uses six 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 (67,-426,360).
FORMULA
a(n) = (50*60^n - 59*6^n + 9) / 2655.
a(n) = 61*a(n-1) - 60*a(n-2) + 6^(n-1) for n > 1.
G.f.: x / (1 - 67*x + 426*x^2 -360*x^3).
a(n) = 67*a(n-1) - 426*a(n-2) + 360*a(n-3) for n > 2.
EXAMPLE
For n=2, the sum of all positive integers whose decimal notation is only made of, let's say, the 4,5,6,7,8,9 digits with at most n=2 such digits, i.e. the sum 4+5+6+7+8+9+44+45+46+47+48+49+54+55+56+57+58+59+64+65+66+67+68+69+74+75+76+77+78+79+84+85+86+87+88+89+94+95+96+97+98+99 is equal to a(2)*(4+5+6+7+8+9) = 67*39 = 2613.
MATHEMATICA
LinearRecurrence[{67, -426, 360}, {0, 1, 67}, 20] (* Harvey P. Dale, Feb 11 2022 *)
PROG
(Python) [(50*60**n-59*6**n+9)//2655 for n in range(20)]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pierre-Alain Sallard, Nov 26 2019
STATUS
approved