cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-6 of 6 results.

A004753 Numbers whose binary expansion contains 100.

Original entry on oeis.org

4, 8, 9, 12, 16, 17, 18, 19, 20, 24, 25, 28, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 44, 48, 49, 50, 51, 52, 56, 57, 60, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 88, 89, 92, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A003754.
Subsequence of A247875.

Programs

  • Haskell
    a004753 n = a004753_list !! (n-1)
    a004753_list = filter f [0..] where
       f 0 = False; f x = x `mod` 4 == 0 || f (x `div` 2)
    -- Reinhard Zumkeller, Oct 27 2011
    
  • Mathematica
    Select[Range[110],MemberQ[Partition[IntegerDigits[#,2],3,1],{1,0,0}]&] (* Harvey P. Dale, Mar 14 2014 *)
  • PARI
    is(n)=n=binary(n);for(i=3,#n,if(n[i-2]&&!n[i]&&!n[i-1],return(1)));0 \\ Charles R Greathouse IV, Sep 24 2012
    
  • PARI
    is(n)=while(n>3, if(bitand(n,7)==4, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 24 2012

A004748 Binary expansion contains 101.

Original entry on oeis.org

5, 10, 11, 13, 20, 21, 22, 23, 26, 27, 29, 37, 40, 41, 42, 43, 44, 45, 46, 47, 52, 53, 54, 55, 58, 59, 61, 69, 74, 75, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 101, 104, 105, 106, 107, 108, 109, 110, 111, 116, 117, 118, 119, 122
Offset: 1

Views

Author

Keywords

Examples

			20 is in the sequence because 20 = 10100_2. '10100' has '101' as one of its substrings. - _Indranil Ghosh_, Feb 11 2017
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], MemberQ[Partition[IntegerDigits[#, 2], 3, 1], {1, 0, 1}] &] (* Vincenzo Librandi, Feb 17 2018 *)
    Select[Range[200],SequenceCount[IntegerDigits[#,2],{1,0,1}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 01 2020 *)
  • PARI
    is(n)=while(n>4,if(bitand(n,7)==5, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
  • Python
    i=j=0
    while j<=100:
        if "101" in bin(i)[2:]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 11 2017
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Oct 23 2015

Extensions

Offset corrected by Charles R Greathouse IV, Feb 11 2017

A004749 Numbers whose binary expansion contains the substring '110'.

Original entry on oeis.org

6, 12, 13, 14, 22, 24, 25, 26, 27, 28, 29, 30, 38, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 70, 76, 77, 78, 86, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113
Offset: 1

Views

Author

Keywords

Examples

			22 is in the sequence because 22 = 10110_2 and '10110' has '110' as one of its substrings. - _Indranil Ghosh_, Feb 11 2017
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200],SequenceCount[IntegerDigits[#,2],{1,1,0}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 07 2017 *)
  • PARI
    is(n)=while(n>5,if(bitand(n,7)==6, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
  • Python
    i=j=0
    while j<=500:
        if "110" in bin(i)[2:]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 11 2017
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Oct 23 2015

Extensions

Offset corrected by Charles R Greathouse IV, Feb 11 2017

A004752 Binary expansion contains 010.

Original entry on oeis.org

10, 18, 20, 21, 26, 34, 36, 37, 40, 41, 42, 43, 50, 52, 53, 58, 66, 68, 69, 72, 73, 74, 75, 80, 81, 82, 83, 84, 85, 86, 87, 90, 98, 100, 101, 104, 105, 106, 107, 114, 116, 117, 122, 130, 132, 133, 136, 137, 138, 139, 144, 145, 146, 147, 148, 149, 150
Offset: 1

Views

Author

Keywords

Examples

			20 is in the sequence because, 20 = 10100_2 and '10100' has '010' as one of its substrings. - _Indranil Ghosh_, Feb 11 2017
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 150, Length@ SequencePosition[IntegerDigits[#, 2], {0, 1, 0}] > 0 &] (* Version 10.1, or *)
    Select[Range@ 150, MemberQ[Partition[IntegerDigits[#, 2], 3, 1], {0, 1, 0}] &] (* Michael De Vlieger, Feb 11 2017 *)
  • PARI
    is(n)=while(n>9, if(bitand(n, 7)==2, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
  • Python
    i=j=0
    while j<=100:
        if "010" in bin(i)[2:]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 11 2017
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Oct 23 2015

Extensions

Offset corrected by Charles R Greathouse IV, Feb 11 2017

A004751 Binary expansion contains 001.

Original entry on oeis.org

9, 17, 18, 19, 25, 33, 34, 35, 36, 37, 38, 39, 41, 49, 50, 51, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 89, 97, 98, 99, 100, 101, 102, 103, 105, 113, 114, 115, 121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139
Offset: 1

Views

Author

Keywords

Examples

			19 is in the sequence because 19 = 10011_2 and '10011' has '001' as one of its substrings. - _Indranil Ghosh_, Feb 11 2017
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 139, Length@ SequencePosition[IntegerDigits[#, 2], {0, 0, 1}] > 0 &] (* Version 10.1, or *)
    Select[Range@ 139, MemberQ[Partition[IntegerDigits[#, 2], 3, 1], {0, 0, 1}] &] (* Michael De Vlieger, Feb 11 2017 *)
    Select[Range[150],SequenceCount[IntegerDigits[#,2],{0,0,1}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 15 2018 *)
  • PARI
    is(n)=while(n>8, if(bitand(n,7)==1, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
  • Python
    i=j=0
    while j<=100:
        if "001" in bin(i)[2:]:
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 11 2017
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Oct 23 2015

Extensions

Offset corrected by Charles R Greathouse IV, Feb 11 2017

A232580 Number of binary sequences of length n that contain at least one contiguous subsequence 011.

Original entry on oeis.org

0, 0, 0, 1, 4, 12, 31, 74, 168, 369, 792, 1672, 3487, 7206, 14788, 30185, 61356, 124308, 251199, 506578, 1019920, 2050785, 4119280, 8267216, 16580799, 33236622, 66594636, 133385689, 267089188, 534692604, 1070217247, 2141780762, 4285739832, 8575004241
Offset: 0

Views

Author

Geoffrey Critzer, Nov 26 2013

Keywords

Comments

From Gus Wiseman, Jun 26 2022: (Start)
Also the number of integer compositions of n + 1 with an even part other than the first or last. For example, the a(3) = 1 through a(5) = 12 compositions are:
(121) (122) (123)
(221) (141)
(1121) (222)
(1211) (321)
(1122)
(1212)
(1221)
(2121)
(2211)
(11121)
(11211)
(12111)
The odd version is A274230.
(End)

Examples

			a(4) = 4 because we have: 0011, 0110, 0111, 1011.
		

Crossrefs

The complement is counted by A000071(n) = A001911(n) + 1.
For the contiguous pattern (1,1) or (0,0) we have A000225.
For the contiguous pattern (1,0,1) or (0,1,0) we have A000253.
For the contiguous pattern (1,0) or (0,1) we have A000295.
Numbers whose binary expansion is of this type are A004750.
For the contiguous pattern (1,1,1) or (0,0,0) we have A050231.
The not necessarily contiguous version is A324172.

Programs

  • Mathematica
    nn=40;a=x/(1-x);CoefficientList[Series[a^2 x/(1-a x)/(1-2x),{x,0,nn}],x]
    (* second program *)
    Table[Length[Select[Tuples[{0,1},n],MatchQ[#,{_,0,1,1,_}]&]],{n,0,10}] (* Gus Wiseman, Jun 26 2022 *)
  • PARI
    concat(vector(3), Vec(x^3/(-2*x^4+x^3+4*x^2-4*x+1) + O(x^40))) \\ Colin Barker, Nov 03 2016

Formula

O.g.f.: x^3/( (1-x)^2*(1-x^2/(1-x))*(1-2x) ).
a(n) ~ 2^n.
From Colin Barker, Nov 03 2016: (Start)
a(n) = (1 + 2^n - (2^(-n)*((1-sqrt(5))^n*(-2+sqrt(5)) + (1+sqrt(5))^n*(2+sqrt(5))))/sqrt(5)).
a(n) = 4*a(n-1) - 4*a(n-2) - a(n-3) + 2*a(n-4) for n > 3. (End)
a(n) = 2^n - Fibonacci(n+3) + 1. - Ehren Metcalfe, Dec 27 2018
E.g.f.: 2*exp(x/2)*(5*exp(x)*cosh(x/2) - 5*cosh(sqrt(5)*x/2) - 2*sqrt(5)*sinh(sqrt(5)*x/2))/5. - Stefano Spezia, Apr 06 2022
Showing 1-6 of 6 results.