login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214838 Triangular numbers of the form k^2 + 2. 4

%I #34 Sep 08 2022 08:46:02

%S 3,6,66,171,2211,5778,75078,196251,2550411,6666726,86638866,226472403,

%T 2943171003,7693394946,99981175206,261348955731,3396416785971,

%U 8878171099878,115378189547778,301596468440091,3919462027838451,10245401755863186,133146330756959526,348042063230908203

%N Triangular numbers of the form k^2 + 2.

%C Corresponding k values are in A077241.

%C Except 3, all terms are in A089982: in fact, a(2) = 3+3 and a(n) = (k-2)*(k-1)/2+(k+1)*(k+2)/2, where k = sqrt(a(n)-2) > 2 for n > 2. [_Bruno Berselli_, Mar 08 2013]

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

%F G.f.: -3*x*(x^4+x^3-14*x^2+x+1)/((x-1)*(x^2-6*x+1)*(x^2+6*x+1)). - _Joerg Arndt_, Mar 08 2013

%F a(n) = A000217(t), where t = ((5-2*sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2))+(5+2*sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))-2)/4. - _Bruno Berselli_, Mar 08 2013

%e 2211 is in the sequence because 2211 = 47^2 + 2.

%t LinearRecurrence[{1, 34, -34, -1, 1}, {3, 6, 66, 171, 2211}, 25] (* _Bruno Berselli_, Mar 08 2013 *)

%o (Python)

%o import math

%o for i in range(2, 1L<<32):

%o t = i*(i+1)/2 - 2

%o sr = int(math.sqrt(t))

%o if sr*sr == t:

%o print '%10d' % sr, '%10d' % i, t+2

%o (PARI) for(n=1, 10^9, t=n*(n+1)/2; if(issquare(t-2), print1(t,", "))); \\ _Joerg Arndt_, Mar 08 2013

%o (Magma) m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(-3*(x^4+x^3-14*x^2+x+1)/((x-1)*(x^2-6*x+1)*(x^2+6*x+1)))); // _Bruno Berselli_, Mar 08 2013

%o (Maxima)

%o t[n]:=((5-2*sqrt(2))*(1+(-1)^n*sqrt(2))^(2*floor(n/2))+(5+2*sqrt(2))*(1-(-1)^n*sqrt(2))^(2*floor(n/2))-2)/4$

%o makelist(expand(t[n]*(t[n]+1)/2), n, 1, 25); /* _Bruno Berselli_, Mar 08 2013 */

%Y Cf. A000217, A001110, A001219, A006454, A029549, A069017, A077241, A089982, A164055, A165892.

%K nonn,easy

%O 1,1

%A _Alex Ratushnyak_, Mar 07 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 10:13 EDT 2024. Contains 371905 sequences. (Running on oeis4.)