login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A029578 The natural numbers interleaved with the even numbers. 21
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, 14, 28, 15, 30, 16, 32, 17, 34, 18, 36, 19, 38, 20, 40, 21, 42, 22, 44, 23, 46, 24, 48, 25, 50, 26, 52, 27, 54, 28, 56, 29, 58, 30, 60, 31, 62, 32, 64, 33, 66, 34, 68, 35, 70, 36, 72 (list; graph; refs; listen; history; text; internal format)
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
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
Cf. A065423 (at least one even summand).
Cf. A009531.
Cf. A001477, A005843, A211538 (partial sums).
Cf. A265705.
Sequence in context: A321015 A365195 A365433 * A054345 A368582 A352956
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Explicated definition by Reinhard Zumkeller, Nov 27 2012
Title simplified by Sean A. Irvine, Feb 29 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 02:22 EDT 2024. Contains 371767 sequences. (Running on oeis4.)