%I M1767 #72 May 24 2024 16:27:29
%S 2,7,25,89,317,1129,4021,14321,51005,181657,646981,2304257,8206733,
%T 29228713,104099605,370756241,1320467933,4702916281,16749684709,
%U 59654886689,212464029485,756701861833,2695033644469,9598504657073,34185581260157,121753753094617,433632421804165
%N a(n) = 3*a(n-1) + 2*a(n-2), with a(0)=2, a(1)=7.
%C Number of subsequences of [1,...,2n+1] in which each even number has an odd neighbor.
%C Same as Pisot sequence E(2,7) (see A008776).
%C 8*a(n) = A007482(n+2) + A007483(n+1) (conjectured, see A104934 for related formula). - _Creighton Dement_, Apr 15 2005
%C Conjecture verified using generating functions. - _Robert Israel_, Jul 12 2018
%C a(n) = sum of the elements of the matrix M^n, where M = {{1, 2}, {2, 2}}. - _Griffin N. Macris_, Mar 25 2016
%C a(3) = 25 is the only composite among the first 8 terms, but then the density of primes decreases, dropping below 50% at the 27th term. - _M. F. Hasler_, Jul 12 2018
%C a(n) is also the number of dominating sets in the (2n+1)-triangular snake graph for n > 0. - _Eric W. Weisstein_, Jun 09 2019
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Reinhard Zumkeller, <a href="/A007484/b007484.txt">Table of n, a(n) for n = 0..1000</a>
%H R. K. Guy and W. O. J. Moser, <a href="http://www.fq.math.ca/Scanned/34-2/guy.pdf">Numbers of subsequences without isolated odd members</a>, Fibonacci Quarterly 34:2 (1996), pp. 152-155.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DominatingSet.html">Dominating Set</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TriangularSnakeGraph.html">Triangular Snake Graph</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (3,2).
%F a(n) = nearest integer to (and converges rapidly to) (1+4/sqrt(17))*((3+sqrt(17))/2)^n. - _N. J. A. Sloane_, Jul 30 2016
%F If p[i] = Fibonacci(i+2) and if A is the Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)= det A. - _Milan Janjic_, May 08 2010
%F G.f.: (2 + x)/(1 - 3*x - 2*x^2). - _M. F. Hasler_, Jul 12 2018
%F From _G. C. Greubel_, Jul 18 2021: (Start)
%F a(n) = (i*sqrt(2))^(n-1)*( i*2*sqrt(2)*ChebyshevU(n, -3*i/(2*sqrt(2))) + ChebyshevU(n-1, -3*i/(2*sqrt(2))) ).
%F a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*((7*n-8*k)/(n-k))*2^k*3^(n-2*k-1) with a(0) = 2. (End)
%F If we extend the definition of A007483(m) to negative m by using the recurrence, then a(n) = A007483(-3-n)*(-2)^n holds for all n in Z. - _Michael Somos_, Jul 19 2021
%F E.g.f.: 2*exp(3*x/2)*(17*cosh(sqrt(17)*x/2) + 4*sqrt(17)*sinh(sqrt(17)*x/2))/17. - _Stefano Spezia_, May 24 2024
%e G.f. = 2 + 7*x + 25*x^2 + 89*x^3 + 317*x^4 + 1129*x^5 + ... - _Michael Somos_, Jul 19 2021
%p A007484 := proc(n) option remember; if n=0 then 2; elif n=1 then 7; else 3*A007484(n-1)+2*A007484(n-2); fi; end;
%t LinearRecurrence[{3, 2}, {2, 7}, 40] (* _Harvey P. Dale_, Apr 24 2012 *)
%t Table[(2^-n ((3 - Sqrt[17])^n (-4 + Sqrt[17]) + (3 + Sqrt[17])^n (4 + Sqrt[17])))/Sqrt[17], {n, 0, 20}] // Expand (* _Eric W. Weisstein_, Jun 09 2019 *)
%t CoefficientList[Series[(2+x)/(1 -3x -2x^2), {x, 0, 20}], x] (* _Eric W. Weisstein_, Jun 09 2019 *)
%t a[ n_] := MatrixPower[{{1, 2}, {2, 2}}, n]//Flatten//Total; (* _Michael Somos_, Jul 19 2021 *)
%o (Haskell)
%o a007484 n = a007484_list !! n
%o a007484_list = 2 : 7 : zipWith (+)
%o (map (* 3) $ tail a007484_list) (map (* 2) a007484_list)
%o -- _Reinhard Zumkeller_, Nov 02 2015
%o (PARI) a(n)=([0,1; 2,3]^n*[2;7])[1,1] \\ _Charles R Greathouse IV_, Mar 25 2016
%o (PARI) A007484_vec(N)=Vec((2+x)/(1-3*x-2*x^2)+O(x^n)) \\ _M. F. Hasler_, Jul 12 2018
%o (Magma) A007484:=[2, 7]; [n le 2 select A007484[n] else 3*Self(n-1)+2*Self(n-2): n in [1..40]]; // _Wesley Ivan Hurt_, Jan 24 2017
%o (Sage) [(i*sqrt(2))^(n-1)*( i*2*sqrt(2)*chebyshev_U(n, -3*i/(2*sqrt(2))) + chebyshev_U(n-1, -3*i/(2*sqrt(2))) ) for n in (0..30)] # _G. C. Greubel_, Jul 18 2021
%Y Cf. A007455, A007481, A007483, A007484, A104934.
%Y See A008776 for definitions of Pisot sequences.
%K easy,nonn,nice
%O 0,1
%A _N. J. A. Sloane_
%E Definition edited by _N. J. A. Sloane_, Jul 30 2016