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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A002249 a(n) = a(n-1) - 2*a(n-2) with a(0) = 2, a(1) = 1. 15
2, 1, -3, -5, 1, 11, 9, -13, -31, -5, 57, 67, -47, -181, -87, 275, 449, -101, -999, -797, 1201, 2795, 393, -5197, -5983, 4411, 16377, 7555, -25199, -40309, 10089, 90707, 70529, -110885, -251943, -30173, 473713, 534059, -413367, -1481485 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

4*2^n = A002249(n)^2 + 7*A001607(n)^2. See A077020, A077021.

Among presented initial elements of the sequence a(n), the maximal increasing or decreasing subsequences have length either 3 or 4. - Roman Witula, Aug 21 2012

This is the Lucas Sequence V_n(P, Q) = V_n(1, 2). U_n(1, 2) = A107920(n). - Raphie Frank, Dec 25 2013

The only numbers that occur more than once are 1=a(1)=a(4) and -5=a(3)=a(9). See Noam D. Elkies's posting in the Mathematics Stack Exchange link. - Robert Israel, Dec 21 2016

LINKS

T. D. Noe, Table of n, a(n) for n = 0..500

Paul Barry, On a Central Transform of Integer Sequences, arXiv:2004.04577 [math.CO], 2020.

Mathematics Stack Exchange, An exotic sequence, March 2014.

Wikipedia, Lucas Sequence.

Index entries for linear recurrences with constant coefficients, signature (1,-2).

FORMULA

G.f.: (2-x)/(1-x+2x^2). - Michael Somos, Oct 18 2002

a(n) = trace(A^n) for the square matrix A=[1, -2; 1, 0]. - Paul Barry, Sep 05 2003

a(n) = 2^((n+2)/2)*cos(-n*acot(sqrt(7)/7)). - Paul Barry, Sep 06 2003

a(n) = (-1)^n*(2*A110512(n) - A001607(n)) = ((1 + i*sqrt(7))/2)^n + ((1 - i*sqrt(7))/2)^n. - Roman Witula, Aug 21 2012

G.f.: G(0), where G(k) = 1 + 1/(1 - x*(7*k+1)/(x*(7*k+8) + 2/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 03 2013

(a(A060728(n) - 2))^2 = (A107920(2*(A060728(n)) - 4))^2 = 2^(A060728(n)) - 7 = A227078(n), the Ramanujan-Nagell squares. - Raphie Frank, Dec 25 2013

a(n) = [x^n] ( (1 + x + sqrt(1 + 2*x - 7*x^2))/2 )^n for n >= 1. - Peter Bala, Jun 23 2015

a(n) = (A107920(n+1) + 2*A107920(n+2) - A107920(n+3))/2. - Raphie Frank, Nov 28 2015

V_n(P,Q) = a(k*n) = ((a(k) + sqrt(-7))/2)^n + ((a(k) - sqrt(-7))/2)^n for k is in {1, 2, 3, 5, 13} = (A060728(n) - 2), P is in {1, -3, -5, 11, -181} = a(k), and Q is in {2, 4, 8, 32, 8192} = 2^k = (2*A076046(n) + 2) = (A227078(n) - 7)/4. P^2 - 4*Q = -7. - Raphie Frank, Dec 05 2015

EXAMPLE

We have a(2)-a(7) = a(5)-a(4) = a(6)+a(4) = a(11)-a(10) = a(12)+a(10)=10. Further the following relations: ((1+i*sqrt(7))/2)^4 + ((1-i*sqrt(7))/2)^4 = 1 and ((1+i*sqrt(7))/2)^8 + ((1-i*sqrt(7))/2)^8 = -31. - Roman Witula, Aug 21 2012

G.f. = 2 + x - 3*x^2 - 5*x^3 + x^4 + 11*x^5 + 9*x^6 - 13*x^7 - 31*x^8 + ...

From Raphie Frank, Dec 05 2015: (Start)

V_n(1, 2) = a(1*n) = ((a(1) + sqrt(-7))/2)^n + ((a(1) - sqrt(-7))/2)^n; a(1) = 1.

V_n(-3, 4) = a(2*n) = ((a(2) + sqrt(-7))/2)^n + ((a(2) - sqrt(-7))/2)^n; a(2) = -3.

V_n(-5, 8) = a(3*n) = ((a(3) + sqrt(-7))/2)^n + ((a(3) - sqrt(-7))/2)^n; a(3) = -5.

V_n(11, 32) = a(5*n) = ((a(5) + sqrt(-7))/2)^n + ((a(5) - sqrt(-7))/2)^n; a(5) = 11.

V_n(-181, 8192) = a(13*n) = ((a(13) + sqrt(-7))/2)^n + ((a(13) - sqrt(-7))/2)^n; a(13) = -181.

(End)

MAPLE

A002249 := proc(n) option remember; >if n = 1 then 1 elif n = 2 then -3 else A002249(n-1>)-2*A002249(n-2); fi; end;

MATHEMATICA

LinearRecurrence[{1, -2}, {2, 1}, 50] (* Roman Witula, Aug 21 2012 *)

a[ n_] := 2^(n/2) ChebyshevT[ n, 8^(-1/2)] 2; (* Michael Somos, Jun 02 2014 *)

a[ n_] := 2^Min[0, n] SeriesCoefficient[ (2 - x) / (1 - x + 2 x^2), {x, 0, Abs @ n}]; (* Michael Somos, Jun 02 2014 *)

Table[2 Re[((1 + I Sqrt[7])/2)^n], {n, 0, 40}] (* Jean-François Alcover, Jun 02 2017 *)

PROG

(PARI) {a(n) = if( n<0, 2^n * a(-n), polsym(2 - x + x^2, n)[n+1])}; /* Michael Somos, Jun 02 2014 */

(PARI) {a(n) = 2 * real( ((1 + quadgen(-28)) / 2)^n )}; /* Michael Somos, Jun 02 2014 */

(PARI) x='x+O('x^100); Vec((2-x)/(1-x+2*x^2)) \\ Altug Alkan, Dec 04 2015

(Sage) [lucas_number2(n, 1, 2) for n in range(0, 40)] # Zerinvary Lajos, Apr 30 2009

(Magma) I:=[2, 1]; [n le 2 select I[n] else Self(n-1)-2*Self(n-2): n in [1..50]]; // Vincenzo Librandi, Nov 29 2015

(Python)

from sympy import sqrt, re, I

def a(n): return 2*re(((1 + I*sqrt(7))/2)**n)

print([a(n) for n in range(40)]) # Indranil Ghosh, Jun 02 2017

CROSSREFS

Cf. A014551, A107920, A060728.

Sequence in context: A058168 A058169 A178074 * A157127 A066748 A106583

Adjacent sequences: A002246 A002247 A002248 * A002250 A002251 A002252

KEYWORD

sign,easy

AUTHOR

N. J. A. Sloane, Iwan Duursma

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 December 5 19:04 EST 2022. Contains 358588 sequences. (Running on oeis4.)