login
a(n) = 6*a(n-1) - a(n-2) + 2, with a(0)=1, a(1)=4.
17

%I #42 Apr 19 2022 17:33:24

%S 1,4,25,148,865,5044,29401,171364,998785,5821348,33929305,197754484,

%T 1152597601,6717831124,39154389145,228208503748,1330096633345,

%U 7752371296324,45184131144601,263352415571284,1534930362283105,8946229758127348,52142448186480985

%N a(n) = 6*a(n-1) - a(n-2) + 2, with a(0)=1, a(1)=4.

%C The product of three consecutive triangular numbers with middle term A000217(m) where m is in this sequence is a square.

%C k is in this sequence iff the triangle with sides 3,k,k+1 has integer area. Equivalently, numbers k such that 2*(k+2)*(k-1) is a square. - _James R. Buddenhagen_, Oct 19 2008

%C Triangular numbers that are equal to a square plus one have this sequence as indices. For example, the 25th triangular number is 25*26/2 = 325 = 18^2 + 1. - _Tanya Khovanova_ and Alexey Radul, Aug 08 2009

%C The triangle with sides 3, a(n), a(n)+1 has area A075848(n) if n>=0. - _Michael Somos_, Dec 25 2018

%C Compare with A016064 for integers m with triangles with sides 4, m, m+2 and integer area. - _Michael Somos_, May 11 2019

%H Reinhard Zumkeller, <a href="/A072221/b072221.txt">Table of n, a(n) for n = 0..1000</a>

%H Sylvester Robins, <a href="https://www.jstor.org/stable/2968647">Certain Series of Integral, Rational, Scalene Triangles</a>, The American Mathematical Monthly, Vol. 1, No. 1 (Jan., 1894), pp. 13-14. See Example I.

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

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

%F a(n) = 3*A001108(n) + 1. - _David Scheers_, Dec 25 2006

%F From _Franz Vrabec_, Aug 21 2006: (Start)

%F a(n) = -1/2 + (3/4)*((3+sqrt(8))^n + (3-sqrt(8))^n) for n >= 0.

%F a(n) = floor((3/4)*(3+sqrt(8))^n) for n > 0. (End)

%F G.f.: (1-3x+4x^2)/((1-x)(1-6x+x^2)). - _R. J. Mathar_, Sep 09 2008

%F a(n) = a(-n) for all n in Z. - _Michael Somos_, Dec 25 2018

%e From _Michael Somos_, Dec 25 2018: (Start)

%e For n=1, the triangle (3, 4, 5) has area 6 = A075848(1).

%e For n=2, the triangle (3, 25, 26) has area 36 = A075848(2). (End)

%t a[n_] := a[n] = 6a[n - 1] - a[n - 2] + 2; a[0] = 1; a[1] = 4; Table[ a[n], {n, 0, 20}]

%t LinearRecurrence[{7, -7, 1}, {1, 4, 25}, 25] (* _T. D. Noe_, Dec 09 2013 *)

%t a[ n_] := (3 ChebyshevT[ n, 3] - 1) / 2; (* _Michael Somos_, Dec 25 2018 *)

%o (Haskell)

%o a072221 n = a072221_list !! n

%o a072221_list = 1 : 4 : (map (+ 2) $

%o zipWith (-) (map (* 6) $ tail a072221_list) a072221_list)

%o -- _Reinhard Zumkeller_, Apr 27 2012

%o (PARI) {a(n) = (3 * polchebyshev( n, 1, 3) - 1) / 2}; /* _Michael Somos_, Dec 25 2018 */

%Y Cf. A000217, A001108, A001541, A016064, A075848.

%K nonn,easy

%O 0,2

%A _Lekraj Beedassy_, Jul 04 2002

%E Edited by _Robert G. Wilson v_, Jul 08 2002