login
a(n) = 18*n^2 - 1.
3

%I #26 Mar 07 2023 02:26:59

%S 17,71,161,287,449,647,881,1151,1457,1799,2177,2591,3041,3527,4049,

%T 4607,5201,5831,6497,7199,7937,8711,9521,10367,11249,12167,13121,

%U 14111,15137,16199,17297,18431,19601,20807,22049,23327,24641,25991,27377,28799,30257,31751

%N a(n) = 18*n^2 - 1.

%C The identity (18*n^2 - 1)^2 - (81*n^2 - 9)*(2*n)^2 = 1 can be written as a(n)^2 - A157909(n)*A005843(n)^2 = 1. - _Vincenzo Librandi_, Feb 08 2012

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

%H Vincenzo Librandi, <a href="https://web.archive.org/web/20090309225914/http://mathforum.org/kb/message.jspa?messageID=5785989&amp;tstart=0">X^2-AY^2=1</a>, Math Forum, 2007. [Wayback Machine link]

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

%F From _Vincenzo Librandi_, Feb 08 2012: (Start)

%F G.f.: x*(-17 - 20*x + x^2)/(x - 1)^3.

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

%F From _Amiram Eldar_, Mar 07 2023: (Start)

%F Sum_{n>=1} 1/a(n) = (1 - cot(Pi/(3*sqrt(2)))*Pi/(3*sqrt(2)))/2.

%F Sum_{n>=1} (-1)^(n+1)/a(n) = (cosec(Pi/(3*sqrt(2)))*Pi/(3*sqrt(2)) - 1)/2. (End)

%t 18Range[40]^2-1 (* _Harvey P. Dale_, Mar 24 2011 *)

%t LinearRecurrence[{3, -3, 1}, {17, 71, 161}, 50] (* _Vincenzo Librandi_, Feb 08 2012 *)

%o (Magma) I:=[17, 71, 161]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+1*Self(n-3): n in [1..40]]; // _Vincenzo Librandi_, Feb 08 2012

%o (PARI) for(n=1, 40, print1(18*n^2 - 1", ")); \\ _Vincenzo Librandi_, Feb 08 2012

%Y Cf. A157909, A005843.

%K nonn,easy

%O 1,1

%A _Vincenzo Librandi_, Mar 09 2009