login
A214838
Triangular numbers of the form k^2 + 2.
4
3, 6, 66, 171, 2211, 5778, 75078, 196251, 2550411, 6666726, 86638866, 226472403, 2943171003, 7693394946, 99981175206, 261348955731, 3396416785971, 8878171099878, 115378189547778, 301596468440091, 3919462027838451, 10245401755863186, 133146330756959526, 348042063230908203
OFFSET
1,1
COMMENTS
Corresponding k values are in A077241.
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]
FORMULA
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
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
EXAMPLE
2211 is in the sequence because 2211 = 47^2 + 2.
MATHEMATICA
LinearRecurrence[{1, 34, -34, -1, 1}, {3, 6, 66, 171, 2211}, 25] (* Bruno Berselli, Mar 08 2013 *)
PROG
(Python)
import math
for i in range(2, 1L<<32):
t = i*(i+1)/2 - 2
sr = int(math.sqrt(t))
if sr*sr == t:
print '%10d' % sr, '%10d' % i, t+2
(PARI) for(n=1, 10^9, t=n*(n+1)/2; if(issquare(t-2), print1(t, ", "))); \\ Joerg Arndt, Mar 08 2013
(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
(Maxima)
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$
makelist(expand(t[n]*(t[n]+1)/2), n, 1, 25); /* Bruno Berselli, Mar 08 2013 */
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Mar 07 2013
STATUS
approved