A146966 a(n) = ((6 + sqrt(7))^n + (6 - sqrt(7))^n) / 2.
1, 6, 43, 342, 2857, 24366, 209539, 1807854, 15617617, 134983638, 1166892763, 10088187654, 87218361721, 754062898686, 6519422294323, 56365243469982, 487319675104417, 4213244040623526, 36426657909454219, 314935817735368374
Offset: 0
Keywords
Examples
a(3) = ((6 + sqrt(7))^3 + (6 - sqrt(7))^3) / 2 = 342.
Links
- Robert Israel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (12,-29).
Programs
-
GAP
a:=[1,6];; for n in [3..20] do a[n]:12*a[n-1]-29*a[n-2]; od; a; # G. C. Greubel, Jan 08 2020
-
Magma
Z
:= PolynomialRing(Integers()); N :=NumberField(x^2-7); S:=[ ((6+r7)^n+(6-r7)^n)/2: n in [0..19] ]; [ Integers()!S[j]: j in [1..#S] ]; // Klaus Brockhaus, Nov 05 2008 -
Magma
I:=[1,6]; [n le 2 select I[n] else 12*Self(n-1)-29*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Jan 31 2016
-
Maple
f:= gfun:-rectoproc({a(n) = 12*a(n-1)-29*a(n-2), a(0)=1, a(1)=6},a(n),remember): map(f, [$0..100]); # Robert Israel, Feb 01 2016
-
Mathematica
RecurrenceTable[{a[1]==1, a[2]==6, a[n]== 12 a[n-1] - 29 a[n-2]}, a, {n, 20}] (* Vincenzo Librandi, Jan 31 2016 *) LinearRecurrence[{12,-29},{1,6},20] (* Harvey P. Dale, Apr 17 2018 *)
-
PARI
Vec((1-6*x)/(1-12*x+29*x^2) + O(x^30)); \\ Michel Marcus, Jan 31 2016
-
Sage
def A146966_list(prec): P.
= PowerSeriesRing(ZZ, prec) return P( (1-6*x)/(1-12*x+29*x^2) ).list() A146966_list(20) # G. C. Greubel, Jan 08 2020
Formula
a(n) = 12*a(n-1)-29*a(n-2), a(0)=1, a(1)=6. - Philippe Deléham, Nov 05 2008
G.f.: (1-6*x)/(1-12*x+29*x^2). - Klaus Brockhaus, Nov 05 2008
a(n) = (Sum_{k=0..n} A098158(n,k)*6^(2*k)*7^(n-k))/6^n. - Philippe Deléham, Nov 06 2008
E.g.f.: exp(6*x)*cosh(sqrt(7)*x). - G. C. Greubel, Jan 08 2020
Extensions
Extended beyond a(7) by Klaus Brockhaus, Nov 05 2008
Typo in name corrected by Sean Reeves, Dec 19 2015