OFFSET
0,2
COMMENTS
a(n) is the number of integers k less than 10^n such that the decimal representation of k lacks the digits 1,2,3,4,5,6 and 7 and at least one of the digits 8,9.
Partial sums of the powers of 2 (A000079).
a(n) is the number of elements (all m-dimensional faces) in an n-dimensional simplex (0 <= m <= n). - Sergey Pavlov, Aug 15 2015
a(n) is the total number of matches in a knockout tournament with 2^n players. - Paul Duckett, Dec 12 2022
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Milan Janjic, Enumerative Formulas for Some Functions on Finite Sets
Jerry Metzger and Thomas Richards, A Prisoner Problem Variation, Journal of Integer Sequences, Vol. 18 (2015), Article 15.2.7.
Wikipedia, Simplex Elements (see last column of table).
Index entries for linear recurrences with constant coefficients, signature (3,-2).
FORMULA
a(n-1)^2 + a(n) = a(2n) + 1, a square. - Vincenzo Librandi and Ralf Stephan, Nov 23 2010
G.f.: 1/ ( (1-2*x)*(1-x) ). - R. J. Mathar, Dec 02 2013
a(n) = 3*a(n-1) - 2*a(n-2), n > 1. - Wesley Ivan Hurt, Aug 21 2015
E.g.f.: 2*exp(2*x) - exp(x). - G. C. Greubel, Mar 31 2021
EXAMPLE
a(8) = 2^9 - 1 = 511.
MAPLE
MATHEMATICA
Table[2^(n+1) - 1, {n, 0, 50}] (* Wesley Ivan Hurt, Dec 02 2013 *)
LinearRecurrence[{3, -2}, {1, 3}, 40] (* Harvey P. Dale, Mar 23 2018 *)
PROG
(PARI) first(m)=vector(m, i, i--; 2^(i+1)-1) /* Anders Hellström, Aug 19 2015 */
(Magma) [2^(n+1)-1: n in [0.. 35]]; // Vincenzo Librandi, Aug 20 2015
(Haskell)
a126646 = (subtract 1) . (2 ^) . (+ 1)
a126646_list = iterate ((+ 1) . (* 2)) 1
-- Reinhard Zumkeller, Sep 17 2015
(Sage) [2^(n+1) -1 for n in (0..50)] # G. C. Greubel, Mar 31 2021
(Python)
def A126646(n): return (1<<n+1)-1 # Chai Wah Wu, Mar 18 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aleksandar M. Janjic and Milan Janjic, Feb 08 2007, Feb 13 2007
STATUS
approved