A004766 Numbers whose binary expansion ends 01.
5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225
Offset: 1
Links
- Tanya Khovanova, Recursive Sequences
- Index entries for linear recurrences with constant coefficients, signature (2,-1).
Crossrefs
Essentially same as A016813.
Programs
-
Maple
seq( 4*x+1, x=1..100 );
-
Mathematica
a = {}; k = x^4 + x^3 + x^2 + x + 1; m = k; Do[AppendTo[a, Length[m]]; m = Expand[m*k], {n, 1, 100}]; a (* Artur Jasinski, Oct 06 2008 *) Select[Range[2,250],Take[IntegerDigits[#,2],-2]=={0,1}&] (* or *) LinearRecurrence[{2,-1},{5,9},70] (* Harvey P. Dale, Aug 07 2023 *)
-
PARI
a(n)=4*n+1 \\ Charles R Greathouse IV, Oct 07 2015
Formula
a(n) = 8*n-a(n-1)-2 (with a(1)=5). - Vincenzo Librandi, Nov 18 2010
From Colin Barker, Jun 24 2013: (Start)
a(n) = 2*a(n-1)-a(n-2).
G.f.: -x*(x-5) / (x-1)^2. (End)
E.g.f.: exp(x)*(1 + 4*x) - 1. - Stefano Spezia, Feb 02 2023
Comments