OFFSET
0,2
COMMENTS
Also, numbers m such that 16*m-15 is a square. Therefore, the terms 1 and 4 are the only squares in this sequence.
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
MATHEMATICA
Table[n (n + 1) + 1 - ((2 n + 1) (-1)^n - 1)/4, {n, 0, 50}]
LinearRecurrence[{1, 2, -2, -1, 1}, {1, 4, 6, 15, 19}, 60] (* Vincenzo Librandi, Jan 06 2016 *)
PROG
(PARI) vector(50, n, n--; n*(n+1)+1-((2*n+1)*(-1)^n-1)/4)
(PARI) Vec((1+3*x+3*x^3+x^4)/((1+x)^2*(1-x)^3) + O(x^100)) \\ Altug Alkan, Jan 06 2016
(Sage) [n*(n+1)+1-((2*n+1)*(-1)^n-1)/4 for n in range(50)]
(Python) [n*(n+1)+1-((2*n+1)*(-1)**n-1)/4 for n in range(60)]
(Magma) [n*(n+1)+1-((2*n+1)*(-1)^n-1)/4: n in [0..50]];
(Magma) I:=[1, 4, 6, 15, 19]; [n le 5 select I[n] else Self(n-1) + 2*Self(n-2) -2*Self(n-3)-Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jan 06 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Jan 05 2016
STATUS
approved