login
a(n) = 531441*n^2 - 322218*n + 48842.
3

%I #19 Sep 08 2022 08:45:42

%S 258065,1530170,3865157,7263026,11723777,17247410,23833925,31483322,

%T 40195601,49970762,60808805,72709730,85673537,99700226,114789797,

%U 130942250,148157585,166435802,185776901,206180882,227647745,250177490

%N a(n) = 531441*n^2 - 322218*n + 48842.

%C The identity (531441*n^2 - 322218*n + 48842)^2 - (729*n^2 - 442*n + 67)*(19683*n - 5967)^2 = 1 can be written as a(n)^2 - A157668(n)*A157669(n)^2 = 1.

%H Vincenzo Librandi, <a href="/A157670/b157670.txt">Table of n, a(n) for n = 1..10000</a>

%H Vincenzo Librandi, <a href="http://mathforum.org/kb/message.jspa?messageID=5773864&amp;tstart=0">X^2-AY^2=1</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).

%F a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).

%F G.f.: x*(258065 + 755975*x + 48842*x^2)/(1-x)^3.

%F E.g.f.: (48842 + 209223*x + 531441*x^2)*exp(x) - 48842. - _G. C. Greubel_, Nov 17 2018

%t LinearRecurrence[{3,-3,1},{258065,1530170,3865157},40]

%o (Magma) I:=[258065, 1530170, 3865157]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]];

%o (PARI) a(n) = 531441*n^2 - 322218*n + 48842.

%o (Sage) [531441*n^2 - 322218*n + 48842 for n in (1..40)] # _G. C. Greubel_, Nov 17 2018

%o (GAP) List([1..40], n -> 531441*n^2 - 322218*n + 48842); # _G. C. Greubel_, Nov 17 2018

%Y Cf. A157668, A157669.

%K nonn,easy

%O 1,1

%A _Vincenzo Librandi_, Mar 04 2009