OFFSET
1,2
COMMENTS
A182512 is a bisection. - Olena Kachko, Dec 16 2023
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,16,-16).
FORMULA
G.f.: x*(1+2*x)/(1-x-16*x^2+16*x^3).
a(n) = 4^(n-1) - (4 + (-4)^n)/20. - Robert Israel, Sep 02 2014
a(n) = a(n-1)+16*a(n-2)-16*a(n-3) for n>3. - Colin Barker, May 19 2016
EXAMPLE
1 = 1
11 = 3
10011 = 19
110011 = 51
100110011 = 307
1100110011 = 819
...
MAPLE
seq(4^(n-1) - (4 + (-4)^n)/20, n=1..100); # Robert Israel, Sep 02 2014
MATHEMATICA
t = {}; lst = First@RealDigits[ N[1/5, 100], 2]; Do[ If[ lst[[n]] == 1, AppendTo[t, FromDigits[ Reverse@Take[lst, n], 2]]], {n, 49}]; t
(* The first line establishes the binary expansion of 1/5 to 100 places (A021913, except for start). The loop extracts the first n terms in this sequence and if it ends in "1", reverses digits and converts to decimal. *)
Table[FromDigits[PadLeft[{}, n, {0, 0, 1, 1}], 2], {n, 60}]//Union (* Harvey P. Dale, Mar 15 2016 *)
PROG
(PARI) Vec(x*(1+2*x)/((1-x)*(1-4*x)*(1+4*x)) + O(x^50)) \\ Colin Barker, May 19 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, based on email from Artur Jasinski, with assistance from Dean Hickerson, Ray Chandler and Robert G. Wilson v, Dec 27 2005
STATUS
approved