cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A214838 Triangular numbers of the form k^2 + 2.

This page as a plain text file.
%I A214838 #38 Nov 14 2024 09:08:38
%S A214838 3,6,66,171,2211,5778,75078,196251,2550411,6666726,86638866,226472403,
%T A214838 2943171003,7693394946,99981175206,261348955731,3396416785971,
%U A214838 8878171099878,115378189547778,301596468440091,3919462027838451,10245401755863186,133146330756959526,348042063230908203
%N A214838 Triangular numbers of the form k^2 + 2.
%C A214838 Corresponding k values are in A077241.
%C A214838 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 A214838 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,34,-34,-1,1).
%F A214838 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 A214838 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 A214838 2211 is in the sequence because 2211 = 47^2 + 2.
%t A214838 LinearRecurrence[{1, 34, -34, -1, 1}, {3, 6, 66, 171, 2211}, 25] (* _Bruno Berselli_, Mar 08 2013 *)
%o A214838 (Python)
%o A214838 import math
%o A214838 for i in range(2, 1<<32):
%o A214838       t = i*(i+1)//2 - 2
%o A214838       sr = int(math.sqrt(t))
%o A214838       if sr*sr == t:
%o A214838           print(f'{sr:10} {i:10} {t+2}')
%o A214838 (PARI) for(n=1, 10^9, t=n*(n+1)/2; if(issquare(t-2), print1(t,", "))); \\ _Joerg Arndt_, Mar 08 2013
%o A214838 (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 A214838 (Maxima)
%o A214838 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 A214838 makelist(expand(t[n]*(t[n]+1)/2), n, 1, 25); /* _Bruno Berselli_, Mar 08 2013 */
%Y A214838 Cf. A000217, A001110, A001219, A006454, A029549, A069017, A077241, A089982, A164055, A165892.
%K A214838 nonn,easy
%O A214838 1,1
%A A214838 _Alex Ratushnyak_, Mar 07 2013