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!)
A247564 a(n) = 3*a(n-2) - 4*a(n-4) with a(0) = 2, a(1) = 1, a(2) = 3, a(3) = 1. 3

%I #32 Sep 08 2022 08:46:09

%S 2,1,3,1,1,-1,-9,-7,-31,-17,-57,-23,-47,-1,87,89,449,271,999,457,1201,

%T 287,-393,-967,-5983,-4049,-16377,-8279,-25199,-8641,-10089,7193,

%U 70529,56143,251943,139657,473713,194399,413367,24569,-654751,-703889,-3617721

%N a(n) = 3*a(n-2) - 4*a(n-4) with a(0) = 2, a(1) = 1, a(2) = 3, a(3) = 1.

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

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

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

%F a(n) = A247487(n) * 3^( n == 1 (mod 4) ) for all n in Z.

%F a(2*n) = A247563(n). a(2*n + 1) = A247560(n).

%F 0 = a(n)*(+2*a(n+2)) + a(n+1)*(+2*a(n+1) - 8*a(n+2) + a(n+3)) + a(n+2)*(+a(n+2)) for all n in Z.

%F a(n) = (-1)^floor(n/2)*H(n, n mod 2, 1/2)) for n >= 3 where H(n, a, b) = hypergeom([a - n/2, b - n/2], [1 - n], 8). - _Peter Luschny_, Sep 03 2019

%e G.f. = 2 + x + 3*x^2 + x^3 + x^4 - x^5 - 9*x^6 - 7*x^7 - 31*x^8 - 17*x^9 + ...

%p H := (n, a, b) -> hypergeom([a - n/2, b - n/2], [1 - n], 8):

%p a := n -> `if`(n < 3, [2, 1, 3][n+1], (-1)^iquo(n, 2)*H(n, irem(n, 2), 1/2)):

%p seq(simplify(a(n)), n=0..42); # _Peter Luschny_, Sep 03 2019

%p # second Maple program:

%p a:= n-> (<<0|1>, <-4|3>>^iquo(n, 2, 'r').<[<2, 3>, <1, 1>][1+r]>)[1,1]:

%p seq(a(n), n=0..42); # _Alois P. Heinz_, Sep 03 2019

%t CoefficientList[Series[(2+x-3*x^2-2*x^3)/(1-3*x^2+4*x^4), {x,0,60}], x] (* _G. C. Greubel_, Aug 04 2018 *)

%o (PARI) {a(n) = if( n<0, n=-n; 2^-n, 1) * polcoeff( (2 + x - 3*x^2 - 2*x^3) / (1 - 3*x^2 + 4*x^4) + x * O(x^n), n)};

%o (Haskell)

%o a247564 n = a247564_list !! n

%o a247564_list = [2,1,3,1] ++ zipWith (-) (map (* 3) $ drop 2 a247564_list)

%o (map (* 4) $ a247564_list)

%o -- _Reinhard Zumkeller_, Sep 20 2014

%o (Magma) m:=25; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((2+x-3*x^2-2*x^3)/(1-3*x^2+4*x^4))); // _G. C. Greubel_, Aug 04 2018

%Y Cf. A247487, A247560, A247563.

%K sign,easy

%O 0,1

%A _Michael Somos_, Sep 20 2014

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 09:31 EDT 2024. Contains 371967 sequences. (Running on oeis4.)