OFFSET
0,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..900
Index entries for linear recurrences with constant coefficients, signature (12,-20)
FORMULA
a(n) = 125*10^(n-2) - 2^(n-2) = a(n-1)*10 + 2^n. - Henry Bottomley, Jun 06 2000
G.f.: 1/(1-12*x+20*x^2). - Zerinvary Lajos, Apr 27 2009 [corrected by R. J. Mathar, Mar 14 2011]
a(n) = (5 * 10^n - 2^n) / 4. - Michael Somos, Dec 03 2016
EXAMPLE
G.f. = 1 + 12*x + 124*x^2 + 1248*x^3 + 12496*x^4 + 124992*x^5 + ...
MATHEMATICA
f[n_] := Sum[2^(k - 1)*10^(n - k), {k, n}]; Array[f, 18] (* Robert G. Wilson v, Dec 03 2016 *)
a[ n_] := (5 * 10^n - 2^n) / 4; (* Michael Somos, Dec 03 2016 *)
LinearRecurrence[{12, -20}, {1, 12}, 20] (* Harvey P. Dale, Jul 28 2020 *)
PROG
(Sage) [lucas_number1(n, 12, 20) for n in range(1, 18)] # Zerinvary Lajos, Apr 27 2009
(Sage) [(10^n - 2^n)/8 for n in range(1, 19)] # Zerinvary Lajos, Jun 05 2009
(Magma) [2^n*(5^(n+1)-1)/4: n in [0..20]]; // Vincenzo Librandi, Oct 09 2011
(PARI) Vec(1/((1-2*x)*(1-10*x))+O(x^99)) \\ Charles R Greathouse IV, Sep 23 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved