OFFSET
0,3
COMMENTS
Diagonal sums of A106465.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,1,0,1,0,-1).
FORMULA
G.f.: (1+x+x^2)/((1+x^2)(1-x^2)^2);
a(n) = a(n-2) + a(n-4) - a(n-6);
a(n) = Sum_{k=0..floor(n/2)} (gcd(n-k+1, k+1) mod 2);
a(n) = sin(Pi*n/2)/4 + (n+2)*(-1)^n/8 + 3(n+2)/8;
a(n) = 0^n + Sum_{k=0..n-1} (if(k=floor((n-1)/2) or k=floor(n/2),1,0)*floor((k+2)/2)). - Paul Barry, Nov 22 2009
Also, a(n) = ((3 + (-1)^n)*(n+2) - i*(i^n - (-i)^n))/8, where i is the imaginary unit. - Bruno Berselli, Feb 22 2010
MATHEMATICA
With[{no=36}, Riffle[Range[no], Sort[Join[Range[no/2], Range[no/2]]]]] (* Harvey P. Dale, Feb 20 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, May 03 2005
STATUS
approved