The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A097140 Interleave n and 1-n. 3

%I #27 Mar 08 2023 08:27:58

%S 0,1,1,0,2,-1,3,-2,4,-3,5,-4,6,-5,7,-6,8,-7,9,-8,10,-9,11,-10,12,-11,

%T 13,-12,14,-13,15,-14,16,-15,17,-16,18,-17,19,-18,20,-19,21,-20,22,

%U -21,23,-22,24,-23,25,-24,26,-25,27,-26,28,-27,29,-28,30,-29,31,-30,32,-31

%N Interleave n and 1-n.

%C Partial sums are A097141. Binomial transform is x(1+x)/(1-2x), or A003945 with a leading 0.

%H Reinhard Zumkeller, <a href="/A097140/b097140.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,1,1).

%F G.f.: x*(1 + 2*x)/((1 - x)*(1 + x)^2).

%F a(n) = 3/4 + (2*n - 3)*(-1)^n/4.

%F a(0)=0, a(1)=1, a(2)=1, a(n)=a(n-1)+a(n-2)+a(n-3). - _Harvey P. Dale_, Mar 26 2012

%F G.f.: x*G(0)/(1+x) where G(k) = 1 + 2*x/(1 - x/(x + 2/G(k+1) )); (recursively defined continued fraction). - _Sergei N. Gladkovskii_, Dec 21 2012

%F E.g.f.: ((3 + x)*sinh(x) - x*cosh(x))/2. - _Stefano Spezia_, Mar 07 2023

%t With[{nn=35},Riffle[Range[0,nn],Range[1,-(nn-1),-1]]] (* or *) LinearRecurrence[ {-1,1,1},{0,1,1},70] (* _Harvey P. Dale_, Mar 26 2012 *)

%o (Haskell)

%o import Data.List (transpose)

%o a097140 n = a097140_list !! n

%o a097140_list = concat $ transpose [a001477_list, map (1 -) a001477_list]

%o -- _Reinhard Zumkeller_, Nov 27 2012

%o (PARI) a(n)=3/4+(2*n-3)*(-1)^n/4 \\ _Charles R Greathouse IV_, Sep 02 2015

%Y Cf. A001477, A003945, A097141.

%K easy,sign

%O 0,5

%A _Paul Barry_, Jul 29 2004

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 June 11 12:04 EDT 2024. Contains 373311 sequences. (Running on oeis4.)