Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #46 Mar 01 2020 02:09:43
%S 0,0,1,2,2,4,3,6,4,8,5,10,6,12,7,14,8,16,9,18,10,20,11,22,12,24,13,26,
%T 14,28,15,30,16,32,17,34,18,36,19,38,20,40,21,42,22,44,23,46,24,48,25,
%U 50,26,52,27,54,28,56,29,58,30,60,31,62,32,64,33,66,34,68,35,70,36,72
%N The natural numbers interleaved with the even numbers.
%C a(n) = number of ordered, length two, compositions of n with at least one odd summand - _Len Smiley_, Nov 25 2001
%C Also number of 0's in n-th row of triangle in A071037. - _Hans Havermann_, May 26 2002
%C a(n) = (n - n mod 2)/(2 - n mod 2). - _Reinhard Zumkeller_, Jul 30 2002
%C For n > 2: a(n) = number of odd terms in row n-2 of triangle A265705. - _Reinhard Zumkeller_, Dec 15 2015
%H Reinhard Zumkeller, <a href="/A029578/b029578.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,0,-1).
%F a(n) = (3*n/2-1+(1-n/2)*(-1)^n)/2. a(n+4)=2*a(n+2)-a(n).
%F G.f.: x^2*(2x+1)/(1-x^2)^2; a(n)=floor((n+1)/2)+(n is odd)*floor((n+1)/2)
%F a(n) = floor(n/2)*binomial(2, mod(n, 2)) - _Paul Barry_, May 25 2003
%F a(2*n) = n, a(2*n-1) = 2*n-2. a(-n)=-A065423(n+2).
%F 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
%F a(n) = Sum_{k=0..n-2} gcd(n-k-1, k+1). - _Paul Barry_, May 03 2005
%F For n>6: a(n) = floor(a(n-1)*a(n-2)/a(n-3)). [_Reinhard Zumkeller_, Mar 06 2011]
%t 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 *)
%o (PARI) a(n)=if(n%2,n-1,n/2)
%o (Haskell)
%o import Data.List (transpose)
%o a029578 n = (n - n `mod` 2) `div` (2 - n `mod` 2)
%o a029578_list = concat $ transpose [a001477_list, a005843_list]
%o -- _Reinhard Zumkeller_, Nov 27 2012
%Y Cf. A065423 (at least one even summand).
%Y Cf. A009531.
%Y Cf. A001477, A005843, A211538 (partial sums).
%Y Cf. A265705.
%K nonn,easy
%O 0,4
%A _N. J. A. Sloane_.
%E Explicated definition by _Reinhard Zumkeller_, Nov 27 2012
%E Title simplified by _Sean A. Irvine_, Feb 29 2020