A280173 a(0) = 1, a(n+1) = 2*a(n) + periodic sequence of length 2: repeat [5, -4].
1, 7, 10, 25, 46, 97, 190, 385, 766, 1537, 3070, 6145, 12286, 24577, 49150, 98305, 196606, 393217, 786430, 1572865, 3145726, 6291457, 12582910, 25165825, 50331646, 100663297, 201326590, 402653185, 805306366, 1610612737, 3221225470, 6442450945, 12884901886
Offset: 0
Examples
a(0) = 1, a(1) = 2*1 + 5 = 7, a(2) = 2*7 - 4 = 10, a(3) = 2*10 + 5 = 25.
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Programs
-
Maple
seq(3*2^n-(-1)^n*(1+irem(n+1,2)),n=0..32); # Peter Luschny, Dec 29 2016
-
Mathematica
LinearRecurrence[{2,1,-2},{1,7,10},50] (* Paolo Xausa, Nov 13 2023 *)
-
PARI
Vec((1 + 5*x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Dec 28 2016
Formula
a(2n) = 3*4^n - 2, a(2n+1) = 6*4^n + 1.
a(n+2) = a(n) + 9*2^n, a(0) = 1, a(1) = 7.
From Colin Barker, Dec 28 2016: (Start)
a(n) = 3*2^n - 2 for n even.
a(n) = 3*2^n + 1 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n>2.
G.f.: (1 + 5*x - 5*x^2) / ((1 - x)*(1 + x)*(1 - 2*x)).
(End)
Comments