OFFSET
0,1
COMMENTS
For every n=2k the triple (a(2k-1)^2, a(2k)^2 , a(2k+1)^2) is an arithmetic progression, i.e., 2*a(2k)^2 = a(2k-1)^2 + a(2k+1)^2.
In general a triple((x-y)^2,z^2,(x+y)^2) is an arithmetic progression if and only if x^2+y^2=z^2.
The first differences of this sequence is the interleaved sequence 6,42,24,60,42,78.... = 9*n*(39-27*(-1)^n)/2.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
FORMULA
a(n) = 2*a(n-1)-2*a(n-3)+a(n-4).
G.f.: (17-11*x+19*x^2-7*x^3)/((1+x)*(1-x)^3).
a(n) = (6*n*(3*n+10)+27*(-1)^n+41)/4.
2*a(2n)^2 = a(2n-1)^2 + a(2n+1)^2.
EXAMPLE
For n = 7, a(7)=2*a(6)-2*a(4)+a(3)=2*269-2*149+89=329.
MATHEMATICA
LinearRecurrence[{2, 0, -2, 1}, {17, 23, 65, 89}, 60] (* Harvey P. Dale, Aug 07 2015 *)
PROG
(Magma) I:=[17, 23, 65, 89]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-3)+Self(n-4): n in [1..75]];
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Yasir Karamelghani Gasmallah, Jul 19 2012
STATUS
approved