login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A215458
a(n) = 4*a(n-1) - 7*a(n-2) + 8*a(n-3) - 4*a(n-4) starting 0, 1, 4, 7.
2
0, 1, 4, 7, 8, 11, 28, 71, 144, 259, 484, 991, 2072, 4187, 8236, 16247, 32544, 65587, 131572, 262543, 523688, 1047179, 2096956, 4196903, 8391600, 16775011, 33546244, 67105087, 134230328, 268455611, 536865868, 1073696471, 2147448384, 4295022739
OFFSET
0,3
LINKS
H. C. Williams and R. K. Guy, Some fourth-order linear divisibility sequences, Intl. J. Number Theory 7 (5) (2011) 1255-1277; P1=4, P2=3, Q=2.
FORMULA
G.f.: -x*(-1+2*x^2) / ( (x-1)*(2*x-1)*(2*x^2-x+1) ).
a(n) = A002248(n)/2.
a(n) = (2^n - (1/2 - (i * sqrt(7))/2)^n - (1/2 + (i * sqrt(7))/2)^n + 1)/2 where i = sqrt(-1). - Paul S. Vanderveen, Jul 08 2017
a(n) = 2^(n-1) - 2^(n/2) * cos(n * arctan(sqrt(7))) + 1/2. - Peter Luschny, Jul 26 2017
MATHEMATICA
CoefficientList[Series[-x (-1 + 2 x^2)/((x - 1) (2*x-1) (2 x^2 - x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Dec 23 2012 *)
LinearRecurrence[{4, -7, 8, -4}, {0, 1, 4, 7}, 40] (* Harvey P. Dale, Mar 22 2019 *)
PROG
(Magma) I:=[0, 1, 4, 7]; [n le 4 select I[n] else 4*Self(n-1)-7*Self(n-2)+8*Self(n-3)-4*Self(n-4): n in [1..40]]; // Vincenzo Librandi, Dec 23 2012
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -4, 8, -7, 4]^n*[0; 1; 4; 7])[1, 1] \\ Charles R Greathouse IV, Jul 07 2017
(Sage)
a = lambda n: (2^n - lucas_number2(n, 1, 2) + 1) // 2
print([a(n) for n in range(34)]) # Peter Luschny, Jul 26 2017
CROSSREFS
Sequence in context: A375572 A296029 A000606 * A061932 A270336 A270941
KEYWORD
nonn,easy
AUTHOR
R. J. Mathar, Aug 11 2012
STATUS
approved