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-10 of 12 results. Next

A003754 Numbers with no adjacent 0's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 21, 22, 23, 26, 27, 29, 30, 31, 42, 43, 45, 46, 47, 53, 54, 55, 58, 59, 61, 62, 63, 85, 86, 87, 90, 91, 93, 94, 95, 106, 107, 109, 110, 111, 117, 118, 119, 122, 123, 125, 126, 127, 170, 171, 173, 174, 175, 181
Offset: 1

Views

Author

Keywords

Comments

Theorem (J.-P. Allouche, J. Shallit, G. Skordev): This sequence = A052499 - 1.
Ahnentafel numbers of ancestors contributing the X-chromosome to a female. A280873 gives the male inheritance. - Floris Strijbos, Jan 09 2017 [Equivalence with this sequence pointed out by John Blythe Dobson, May 09 2018]
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. This sequence lists all numbers k such that the k-th composition in standard order has no parts greater than two. See the corresponding example below. - Gus Wiseman, Apr 04 2020
The binary representation of a(n+1) has the same string of digits as the lazy Fibonacci (also known as dual Zeckendorf) representation of n that uses 0s and 1s. (The "+1" is essentially an adjustment for the offset of this sequence.) - Peter Munn, Sep 06 2022

Examples

			21 is in the sequence because 21 = 10101_2. '10101' has no '00' present in it. - _Indranil Ghosh_, Feb 11 2017
From _Gus Wiseman_, Apr 04 2020: (Start)
The terms together with the corresponding compositions begin:
    0: ()            30: (1,1,1,2)         90: (2,1,2,2)
    1: (1)           31: (1,1,1,1,1)       91: (2,1,2,1,1)
    2: (2)           42: (2,2,2)           93: (2,1,1,2,1)
    3: (1,1)         43: (2,2,1,1)         94: (2,1,1,1,2)
    5: (2,1)         45: (2,1,2,1)         95: (2,1,1,1,1,1)
    6: (1,2)         46: (2,1,1,2)        106: (1,2,2,2)
    7: (1,1,1)       47: (2,1,1,1,1)      107: (1,2,2,1,1)
   10: (2,2)         53: (1,2,2,1)        109: (1,2,1,2,1)
   11: (2,1,1)       54: (1,2,1,2)        110: (1,2,1,1,2)
   13: (1,2,1)       55: (1,2,1,1,1)      111: (1,2,1,1,1,1)
   14: (1,1,2)       58: (1,1,2,2)        117: (1,1,2,2,1)
   15: (1,1,1,1)     59: (1,1,2,1,1)      118: (1,1,2,1,2)
   21: (2,2,1)       61: (1,1,1,2,1)      119: (1,1,2,1,1,1)
   22: (2,1,2)       62: (1,1,1,1,2)      122: (1,1,1,2,2)
   23: (2,1,1,1)     63: (1,1,1,1,1,1)    123: (1,1,1,2,1,1)
   26: (1,2,2)       85: (2,2,2,1)        125: (1,1,1,1,2,1)
   27: (1,2,1,1)     86: (2,2,1,2)        126: (1,1,1,1,1,2)
   29: (1,1,2,1)     87: (2,2,1,1,1)      127: (1,1,1,1,1,1,1)
(End)
		

Crossrefs

A104326(n) = A007088(a(n)); A023416(a(n)) = A087116(a(n)); A107782(a(n)) = 0; A107345(a(n)) = 1; A107359(n) = a(n+1) - a(n); a(A001911(n)) = A000225(n); a(A000071(n+2)) = A000975(n). - Reinhard Zumkeller, May 25 2005
Cf. A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A004742 (no 101), A004743 (no 110), A003726 (no 111).
Complement of A004753.
Positions of numbers <= 2 in A333766 (see this and A066099 for other sequences about compositions in standard order).
Cf. A318928.

Programs

  • Haskell
    a003754 n = a003754_list !! (n-1)
    a003754_list = filter f [0..] where
       f x = x == 0 || x `mod` 4 > 0 && f (x `div` 2)
    -- Reinhard Zumkeller, Dec 07 2012, Oct 19 2011
    
  • Maple
    isA003754 := proc(n) local bdgs ; bdgs := convert(n,base,2) ; for i from 2 to nops(bdgs) do if op(i,bdgs)=0 and op(i-1,bdgs)= 0 then return false; end if; end do; return true; end proc:
    A003754 := proc(n) option remember; if n= 1 then 0; else for a from procname(n-1)+1 do if isA003754(a) then return a; end if; end do: end if; end proc:
    # R. J. Mathar, Oct 23 2010
  • Mathematica
    Select[ Range[0, 200], !MatchQ[ IntegerDigits[#, 2], {_, 0, 0, _}]&] (* Jean-François Alcover, Oct 25 2011 *)
    Select[Range[0,200],SequenceCount[IntegerDigits[#,2],{0,0}]==0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, May 21 2015 *)
  • PARI
    is(n)=n=bitor(n,n>>1)+1; n>>=valuation(n,2); n==1 \\ Charles R Greathouse IV, Feb 06 2017
    
  • Python
    i=0
    while i<=500:
        if "00" not in bin(i)[2:]:
            print(str(i), end=',')
        i+=1 # Indranil Ghosh, Feb 11 2017

Formula

Sum_{n>=2} 1/a(n) = 4.356588498070498826084131338899394678478395568880140707240875371925764128502... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022

Extensions

Removed "2" from the name, because, for example, one could argue that 10001 has 3 adjacent zeros, not 2. - Gus Wiseman, Apr 04 2020

A328212 Lazy-Fibonacci-Niven numbers: numbers divisible by the number of terms in their lazy Fibonacci representation (A112310).

Original entry on oeis.org

1, 2, 4, 6, 9, 12, 15, 16, 28, 30, 35, 36, 48, 55, 60, 70, 72, 75, 78, 84, 90, 102, 105, 114, 119, 126, 133, 144, 147, 154, 156, 161, 168, 180, 182, 184, 192, 198, 203, 208, 216, 224, 238, 240, 245, 252, 259, 264, 266, 272, 280, 296, 301, 304, 308, 315, 320, 322
Offset: 1

Views

Author

Amiram Eldar, Oct 07 2019

Keywords

Examples

			6 is in the sequence since A112310(6) = 3 and 3 is a divisor of 6.
		

Crossrefs

Programs

  • Mathematica
    ooQ[n_] := Module[{k = n}, While[k > 3, If[Divisible[k, 4], Return[True], k = Quotient[k, 2]]]; False]; c = 0; s = {}; Do[If[! ooQ[k], c++; d = Total @ IntegerDigits[k, 2]; If[Divisible[c, d], AppendTo[s, c]]], {k, 1, 2000}]; s

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

A004750 Numbers whose binary expansion contains the substring '011'.

Original entry on oeis.org

11, 19, 22, 23, 27, 35, 38, 39, 43, 44, 45, 46, 47, 51, 54, 55, 59, 67, 70, 71, 75, 76, 77, 78, 79, 83, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 99, 102, 103, 107, 108, 109, 110, 111, 115, 118, 119, 123, 131, 134, 135, 139, 140, 141, 142, 143, 147, 150
Offset: 1

Views

Author

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Select[Range[200],MemberQ[Partition[IntegerDigits[#,2],3,1],{0,1,1}]&] (* Harvey P. Dale, Apr 14 2014 *)
    Select[Range[200],SequenceCount[IntegerDigits[#,2],{0,1,1}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 01 2021 *)
  • PARI
    is(n)=while(n>10, if(bitand(n, 7)==3, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
  • Python
    i=j=0
    while j<=100:
        if "011" 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

A004779 Binary expansion contains 3 adjacent 0's.

Original entry on oeis.org

8, 16, 17, 24, 32, 33, 34, 35, 40, 48, 49, 56, 64, 65, 66, 67, 68, 69, 70, 71, 72, 80, 81, 88, 96, 97, 98, 99, 104, 112, 113, 120, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 152, 160, 161, 162, 163, 168
Offset: 0

Views

Author

Keywords

Crossrefs

Complement of A003796.

Programs

Formula

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

A247875 Numbers that are even or whose binary expansions contain one or more pairs of adjacent zeros when odd.

Original entry on oeis.org

0, 2, 4, 6, 8, 9, 10, 12, 14, 16, 17, 18, 19, 20, 22, 24, 25, 26, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 46, 48, 49, 50, 51, 52, 54, 56, 57, 58, 60, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 86
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 25 2014

Keywords

Comments

Complement of A247648; union of A004753 and A005843.

Crossrefs

Programs

  • Haskell
    a247875 n = a247875_list !! (n-1)
    a247875_list = filter (\x -> even x || f x) [0..] where
       f x = x > 0 && (x `mod` 4 == 0 || f (x `div` 2))
    
  • Mathematica
    Module[{upto=100,odds},odds=Select[Range[1,upto,2], SequenceCount[ IntegerDigits[#,2],{0,0}]>0&];Sort[Join[odds,Range[0,upto,2]]]] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Aug 30 2015 *)
  • Python
    A247875_list = [n for n in range(10**3) if not n % 2 or '00' in bin(n)]
    # Chai Wah Wu, Sep 26 2014

Extensions

Definition edited by Chai Wah Wu, Sep 26 2014
Definition clarified by Harvey P. Dale, Aug 30 2015

A319302 Integers whose binary representation contains a consecutive string of zeros of prime length.

Original entry on oeis.org

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

Views

Author

W. Zane Billings, Sep 16 2018

Keywords

Examples

			81 = (1010001)_2 is a term because it contains a run of zeros of length 3, and 3 is a prime. 16 = (10000)_2 is not a term because it contains only a run of 4 zeros and 4 is not a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[120], AnyTrue[ Differences@ Flatten@ Position[ IntegerDigits[ 2*# + 1, 2], 1] - 1, PrimeQ] &] (* Giovanni Resta, Sep 17 2018 *)
  • PARI
    is(n) = my(b=binary(n), i=0); for(k=1, #b, if(b[k]==0, i++); if(b[k]==1 || k==#b, if(ispseudoprime(i), return(1), i=0))); 0 \\ Felix Fröhlich, Sep 17 2018
    
  • Python
    from re import split
    from sympy import isprime
    A319302_list, n  = [], 1
    while len(A319302_list) < 10000:
        for d in split('1+',bin(n)[2:]):
            if isprime(len(d)):
                A319302_list.append(n)
                break
        n += 1 # Chai Wah Wu, Oct 02 2018

Extensions

More terms from Giovanni Resta, Sep 17 2018
Showing 1-10 of 12 results. Next