A004774 Numbers n whose binary expansion does not end in 001.
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77
Offset: 1
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
Programs
-
Mathematica
Join[Range[0, 3], Select[Range[4, 80], Take[IntegerDigits[#, 2], -3] != {0, 0, 1} &]] (* Harvey P. Dale, Feb 18 2011 *) Table[If[n < 9, n - 1, Floor[(8 n - 10)/7]], {n, 69}] (* or *) Rest@ CoefficientList[Series[x^2 (1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^8)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)), {x, 0, 69}], x] (* Michael De Vlieger, Aug 10 2016 *)
-
PARI
a(n)=if(n<9,n-1,(8*n-10)\7) \\ Charles R Greathouse IV, Mar 26 2013
-
PARI
concat(0, Vec(x^2*(1+x+x^2+x^3+x^4+x^5+x^6+x^8)/((1-x)^2*(1+x+x^2+x^3+x^4+x^5+x^6)) + O(x^100))) \\ Colin Barker, Jul 23 2016
Formula
From Colin Barker, Jul 23 2016: (Start)
a(n) = a(n-1)+a(n-7)-a(n-8) for n>8.
G.f.: x^2*(1+x+x^2+x^3+x^4+x^5+x^6+x^8) / ((1-x)^2*(1+x+x^2+x^3+x^4+x^5+x^6)).
(End)
a(1) = 0, a(2) = 1, a(7*n + k + 2) = 8*n + k + 1, n >= 0, 1 <= k < 8. - Yosu Yurramendi, Aug 09 2016
Comments