OFFSET
0,4
COMMENTS
a(n) = number of ordered, length two, compositions of n with at least one odd summand - Len Smiley, Nov 25 2001
Also number of 0's in n-th row of triangle in A071037. - Hans Havermann, May 26 2002
a(n) = (n - n mod 2)/(2 - n mod 2). - Reinhard Zumkeller, Jul 30 2002
For n > 2: a(n) = number of odd terms in row n-2 of triangle A265705. - Reinhard Zumkeller, Dec 15 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) = (3*n/2-1+(1-n/2)*(-1)^n)/2. a(n+4)=2*a(n+2)-a(n).
G.f.: x^2*(2x+1)/(1-x^2)^2; a(n)=floor((n+1)/2)+(n is odd)*floor((n+1)/2)
a(n) = floor(n/2)*binomial(2, mod(n, 2)) - Paul Barry, May 25 2003
a(2*n) = n, a(2*n-1) = 2*n-2. a(-n)=-A065423(n+2).
a(n) = Sum_{k=0..floor((n-2)/2)} (C(n-k-2, k) mod 2)((1+(-1)^k)/2)*2^A000120(n-2k-2). - Paul Barry, Jan 06 2005
a(n) = Sum_{k=0..n-2} gcd(n-k-1, k+1). - Paul Barry, May 03 2005
For n>6: a(n) = floor(a(n-1)*a(n-2)/a(n-3)). [Reinhard Zumkeller, Mar 06 2011]
MATHEMATICA
With[{nn=40}, Riffle[Range[0, nn], Range[0, 2nn, 2]]] (* or *) LinearRecurrence[ {0, 2, 0, -1}, {0, 0, 1, 2}, 80] (* Harvey P. Dale, Aug 23 2015 *)
PROG
(PARI) a(n)=if(n%2, n-1, n/2)
(Haskell)
import Data.List (transpose)
a029578 n = (n - n `mod` 2) `div` (2 - n `mod` 2)
a029578_list = concat $ transpose [a001477_list, a005843_list]
-- Reinhard Zumkeller, Nov 27 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Explicated definition by Reinhard Zumkeller, Nov 27 2012
Title simplified by Sean A. Irvine, Feb 29 2020
STATUS
approved