OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..300
Index entries for linear recurrences with constant coefficients, signature (102,-201,100).
FORMULA
From Bruno Berselli, Aug 02 2011: (Start)
G.f.: x*(100-201*x+100*x^2)/((1-100*x)*(1-x)^2).
a(n) = (9800*100^n+99*n+1)/9801. (End)
EXAMPLE
For n=2: a(2)=100*a(1)-(2-1)=100*100-1=10000-1=9999.
For n=3: a(3)=100*a(2)-(3-1)=100*9999-2=999900-2=999898.
MAPLE
a[1]:=100; for n from 2 to 12 do a[n]:=100*a[n-1]-(n-1); end do;
MATHEMATICA
LinearRecurrence[{102, -201, 100}, {100, 9999, 999898}, 20] (* G. C. Greubel, Feb 06 2019 *)
RecurrenceTable[{a[1]==100, a[n]==100a[n-1]-n+1}, a, {n, 20}] (* Harvey P. Dale, May 17 2019 *)
PROG
(Magma) [n lt 2 select 100 else 100*Self(n-1)-n+1: n in [1..14]]; // Bruno Berselli, Aug 02 2011
(PARI) vector(20, n, (98*10^(2*n+2) +99*n +1)/9801) \\ G. C. Greubel, Feb 06 2019
(Sage) [(98*10^(2*n+2) +99*n +1)/9801 for n in (1..20)] # G. C. Greubel, Feb 06 2019
(GAP) List([1..20], n -> (98*10^(2*n+2) +99*n +1)/9801); # G. C. Greubel, Feb 06 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Francesco Daddi, Aug 02 2011
STATUS
approved