OFFSET
1,1
COMMENTS
Equivalently, both m+1 and 2*m+3 are squares for nonnegative m.
Corresponding triangular numbers T(m): 6, 10296, 12002550, 13855048416, 15988853699286, 18451128064030200, 21292585958400815526, ...
Square roots of T(m) + 3*T(m+1) are listed by A082405 (after 0).
Negative values of m for which T(m) + 3*T(m+1) is a square: -1, -2, -26, -842, -28562, -970226, -32959082, ...
LINKS
Colin Barker, Table of n, a(n) for n = 1..650
Index entries for linear recurrences with constant coefficients, signature (35,-35,1).
FORMULA
O.g.f.: x*(3 + 38*x - x^2)/((1 - x)*(1 - 34*x + x^2)).
E.g.f.: (exp((1-sqrt(2))^4*x) + exp((1+sqrt(2))^4*x) - 10*exp(x))/8 + 1.
a(n) = 35*a(n-1) - 35*a(n-2) + a(n-3) for n>3.
a(n) = 34*a(n-1) - a(n-2) + 40 for n>2.
a(n) = a(-n) = ((1 + sqrt(2))^(4*n) + (1 - sqrt(2))^(4*n))/8 - 5/4.
a(n) = 4*A001109(n)^2 - 1.
Lim_{n -> infinity} a(n)/a(n-1) = A156164.
Floor(sqrt(a(n))) = A182189(n) - 2.
a(n) - a(n-1) = 4*A046176(n) for n>1.
EXAMPLE
3 is in the sequence because T(3) + 3*T(4) = 6 + 3*10 = 6^2.
For n=5 is a(5) = 5654883, therefore floor(sqrt(5654883)) = 2377 = A182189(5) - 2 = 2379 - 2.
MAPLE
P:=proc(q) local n; for n from 3 to q do if type(sqrt(2*n^2+5*n+3), integer) then print(n); fi; od; end: P(10^9); # Paolo P. Lava, Nov 18 2016
MATHEMATICA
Table[((1 + Sqrt[2])^(4 n) + (1 - Sqrt[2])^(4 n))/8 - 5/4, {n, 1, 20}]
RecurrenceTable[{a[1] == 3, a[2] == 143, a[n] == 34 a[n - 1] - a[n - 2] + 40}, a, {n, 1, 20}]
LinearRecurrence[{35, -35, 1}, {3, 143, 4899}, 50] (* G. C. Greubel, Nov 20 2016 *)
PROG
(Sage)
def A278310():
a, b = 3, 143
yield a
while True:
yield b
a, b = b, 34*b - a + 40
a = A278310(); print([next(a) for _ in range(18)]) # Peter Luschny, Nov 18 2016
(PARI) Vec(x*(3 + 38*x - x^2)/((1 - x)*(1 - 34*x + x^2)) + O(x^50)) \\ G. C. Greubel, Nov 20 2016
(Magma) Iv:=[3, 143]; [n le 2 select Iv[n] else 34*Self(n-1)-Self(n-2)+40: n in [1..20]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Nov 17 2016
STATUS
approved