cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A328350 Let S be any integer in the range 6 <= S <= 24. Sequence has the property that a(n)*S is the sum of all positive integers whose decimal expansion has <= n digits and contains at most three distinct nonzero digits d1, d2, d3 such that d1+d2+d3 = S.

Original entry on oeis.org

0, 1, 34, 1033, 31030, 931021, 27930994, 837930913, 25137930670, 754137929941, 22624137927754, 678724137921193, 20361724137901510, 610851724137842461, 18325551724137665314, 549766551724137133873, 16492996551724135539550, 494789896551724130756581, 14843696896551724116407674, 445310906896551724073360953
Offset: 0

Views

Author

Pierre-Alain Sallard, Oct 13 2019

Keywords

Comments

This sequence is the building block for the calculation of the sums of positive integers whose decimal expansion contains only three distinct, nonzero digits: see attached pdf document.

Examples

			For n=2, the sum of all positive integers whose decimal expansions consist of at most n=2 of the digits 5, 6 or 7, i.e., the sum 5+6+7+55+56+57+65+66+67+75+76+77, is equal to a(2)*(5+6+7) = 612.
The formula is valid for any other choice of three distinct digits. Another example: again with n=2, but let's say with the digits 1, 2 and 3, the sum 1+2+3+11+12+13+21+22+23+31+32+33 is equal to a(2)*(1+2+3) = 204.
		

Crossrefs

Programs

  • Mathematica
    Array[(20*30^# - 29*3^# + 9)/522 &, 20, 0] (* or *)
    LinearRecurrence[{34, -123, 90}, {0, 1, 34}, 20] (* Paolo Xausa, Apr 29 2024 *)
  • Python
    [(20*30**n-29*3**n+9)//522 for n in range(20)]

Formula

a(n) = (20*30^n - 29*3^n + 9)/522.
From Stefano Spezia, Oct 17 2019: (Start)
O.g.f.: x/(1 - 34*x + 123*x^2 - 90*x^3).
E.g.f.: (1/522)*(9*exp(x) - 29*exp(3*x) + 20*exp(30*x)).
a(n) = 34*a(n-1) - 123*a(n-2) + 90*a(n-3) for n > 2. (End)
a(n) = 31*a(n-1) - 30*a(n-2) + 3^n for n > 1. - Pierre-Alain Sallard, Dec 15 2019

Extensions

Needs editing. - N. J. A. Sloane, Dec 12 2019