%I #49 Sep 12 2024 03:03:01
%S 1,1,0,1,-1,0,-1,-1,0,-1,1,0,1,1,0,1,-1,0,-1,-1,0,-1,1,0,1,1,0,1,-1,0,
%T -1,-1,0,-1,1,0,1,1,0,1,-1,0,-1,-1,0,-1,1,0,1,1,0,1,-1,0,-1,-1,0,-1,1,
%U 0,1,1,0,1,-1,0,-1,-1,0,-1,1,0,1,1,0,1,-1,0
%N Periodic with repeating part {1,1,0,1,-1,0,-1,-1,0,-1,1,0}.
%C Diagonal sums of number triangle A117440.
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,-1).
%F G.f.: (1+x-x^2)/(1-x^2+x^4).
%F a(n) = Sum_{k=0..floor(n/2)} C(n-k,k)*(cos(Pi*(n-2*k)/2)+sin(Pi*(n-2*k)/2)).
%F a(1)=a(2)=1; a(n) = a(n-2) + (-1)^n*a(n-1). - _José María Grau Ribas_, Jan 08 2012
%F a(n) = A260190(n+2) = A260192(n-1). a(2*n + 1) = A010892(n). a(3*n) = A057077(n). a(3*n + 1) = A087960(n). a(3*n + 2) = 0. - _Michael Somos_, Jul 18 2015
%e G.f. = 1 + x + x^3 - x^4 - x^6 - x^7 - x^9 + x^10 + x^12 + x^13 + x^15 + ...
%t a[1] := 1; a[2] := 1; a[n_] := a[n] = a[n - 2] + (-1)^(n) a[n - 1]; Array[a, 100] (* _José María Grau Ribas_, Jan 08 2012 *)
%t PadRight[{},84,{1,1,0,1,-1,0,-1,-1,0,-1,1,0}] (* _Harvey P. Dale_, Mar 30 2012 *)
%t a[ n_] := KroneckerSymbol[ -6, 2 n + 5]; (* _Michael Somos_, Jul 18 2015 *)
%t LinearRecurrence[{0, 1, 0, -1},{1, 1, 0, 1},78] (* _Ray Chandler_, Aug 25 2015 *)
%o (PARI) Vec((1+x-x^2)/(1-x^2+x^4)+O(x^99)) \\ _Charles R Greathouse IV_, Jan 10 2012
%o (PARI) {a(n) = kronecker( -6, 2*n + 5)}; /* _Michael Somos_, Jul 18 2015 */
%Y Cf. A010892, A057077, A087960, A260190, A260192.
%K easy,sign
%O 0,1
%A _Paul Barry_, Mar 16 2006
%E More terms from _Sean A. Irvine_, Sep 26 2011