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!)
A097065 Interleave n+1 and n-1. 7

%I #21 Jul 02 2023 22:32:23

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

%T 13,16,14,17,15,18,16,19,17,20,18,21,19,22,20,23,21,24,22,25,23,26,24,

%U 27,25,28,26,29,27,30,28,31,29,32,30,33,31,34,32,35,33,36,34,37,35,38

%N Interleave n+1 and n-1.

%C Pairwise sums are abs(A023443), or n - 1 + 2*0^n. The partial sums of this sequence is A000124, with extra leading 1. Partial sums are A097066. Binomial transform is A097067.

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

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

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

%F a(n) = floor((n+2)/2) - 2 * (n mod 2). - _Reinhard Zumkeller_, Apr 06 2015

%F a(n) = a(n-1) + a(n-2) - a(n-3) for n > 2. - _Wesley Ivan Hurt_, Jan 10 2017

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

%p A097065:=n->(2*n-1)/4 + 5*(-1)^n/4: seq(A097065(n), n=0..150); # _Wesley Ivan Hurt_, Jan 10 2017

%t Table[(2n - 1)/4 + 5(-1)^n/4, {n, 0, 75}] (* Or *) Flatten[ Table[{n + 1, n - 1}, {n, 0, 37}]] (* Or *) CoefficientList[Series[(1 - 2x + 2x^2)/((1 + x)(1 - x)^2), {x, 0, 75}], x] (* _Robert G. Wilson v_, Jul 24 2004 *)

%o (Haskell)

%o import Data.List (transpose)

%o a097065 n = n' - 2 * m where (n', m) = divMod (n + 2) 2

%o a097065_list = concat $ transpose [[1 ..], [-1 ..]]

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

%o (Magma) [(2*n-1)/4 + 5*(-1)^n/4 : n in [0..100]]; // _Wesley Ivan Hurt_, Jan 10 2017

%Y Essentially the same as A084964.

%Y Cf. A000124, A023443, A097066, A097067.

%K easy,sign

%O 0,3

%A _Paul Barry_, Jul 22 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 April 25 16:45 EDT 2024. Contains 371989 sequences. (Running on oeis4.)