OFFSET
0,1
COMMENTS
For n > 0, in binary, this is a 1 followed by n-1 0's followed by 10 followed by n 1's.
LINKS
FORMULA
EXAMPLE
a(0) = 2*4^0 + 3*2^0 - 1 = 4; in binary, 100.
a(1) = 2*4^1 + 3*2^1 - 1 = 13; in binary, 1101.
a(2) = 2*4^2 + 3*2^2 - 1 = 43; in binary, 101011.
a(3) = 2*4^3 + 3*2^3 - 1 = 151; in binary, 10010111.
a(4) = 2*4^4 + 3*2^4 - 1 = 559; in binary, 1000101111.
...
MATHEMATICA
Table[2 4^n+3 2^n-1, {n, 0, 30}] (* or *) LinearRecurrence[{7, -14, 8}, {4, 13, 43}, 30] (* Harvey P. Dale, Apr 22 2018 *)
PROG
(PARI) a(n) = 2*4^n + 3*2^n - 1
(PARI) first(n) = Vec((4 - 15*x + 8*x^2)/((1 - x)*(1 - 2*x)*(1 - 4*x)) + O(x^n))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Iain Fox, Jan 08 2018
STATUS
approved