login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A335843 a(n) is the number of n-digit positive integers with exactly two distinct base 10 digits. 5
0, 81, 243, 567, 1215, 2511, 5103, 10287, 20655, 41391, 82863, 165807, 331695, 663471, 1327023, 2654127, 5308335, 10616751, 21233583, 42467247, 84934575, 169869231, 339738543, 679477167, 1358954415, 2717908911, 5435817903, 10871635887, 21743271855, 43486543791 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(n) is the number of n-digit numbers in A031955.
LINKS
Puzzle Critic, Twitter post about the case n = 5, Jul 16 2020.
FORMULA
O.g.f.: 81*x^2/(1 - 3*x + 2*x^2).
E.g.f.: 81*(exp(x) - 1)^2/2.
a(n) = 3*a(n-1) - 2*a(n-2) for n > 2.
a(n) = 81*(2^(n-1) - 1).
a(n) = 81*A000225(n-1).
EXAMPLE
a(1) = 0 since the positive integers must have at least two digits;
a(2) = 81 since #[99] - #[9] - #(11*[9]) = 99 - 9 - 9 = 81;
a(3) = 243 since #[999] - #[99] - #(111*[9]) - #{xyz in N | x,y,z are three different digits with x != 0} = 999 - 99 - 9 - 9*9*8 = 243;
...
MATHEMATICA
LinearRecurrence[{3, -2}, {0, 81}, 31]
PROG
(PARI) concat([0], Vec(81*x^2/(1-3*x+2*x^2)+O(x^31)))
CROSSREFS
Sequence in context: A184068 A211690 A205055 * A255625 A205048 A008876
KEYWORD
nonn,easy,base
AUTHOR
Stefano Spezia, Jul 18 2020
EXTENSIONS
a(0) removed by Stefano Spezia, Sep 23 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 23:40 EDT 2024. Contains 371798 sequences. (Running on oeis4.)