A004743 Numbers whose binary expansion does not contain 110.
0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 23, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 47, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 79, 80, 81, 82, 83, 84, 85, 87, 95, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139
Offset: 1
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- Index entries for 2-automatic sequences.
Crossrefs
Programs
-
Haskell
a004743 n = a004743_list !! (n-1) a004743_list = filter f [0..] where f x = x < 4 || x `mod` 8 /= 6 && f (x `div` 2) -- Reinhard Zumkeller, Jul 01 2013
-
Mathematica
Select[Range[0, 140], !StringContainsQ[IntegerString[#, 2], "110"] &] (* Amiram Eldar, Feb 13 2022 *) Select[Range[0,150],SequenceCount[IntegerDigits[#,2],{1,1,0}]==0&] (* Harvey P. Dale, Mar 14 2025 *)
-
PARI
is(n)=n=binary(n);for(i=3,#n,if(!n[i]&&n[i-2]&&n[i-1],return(0))); 1 \\ Charles R Greathouse IV, Mar 26 2013
-
PARI
is(n)=while(n>5, if(bitand(n,7)==6, return(0)); n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017
Formula
Sum_{n>=2} 1/a(n) = 5.126608057149204485684180689064467269298250594297584060475240185531109866051... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022