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.

Previous Showing 11-20 of 39 results. Next

A004758 Binary expansion starts 110.

Original entry on oeis.org

6, 12, 13, 24, 25, 26, 27, 48, 49, 50, 51, 52, 53, 54, 55, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213
Offset: 1

Views

Author

Keywords

Examples

			26 in binary is 11010, so 26 is in sequence.
		

Crossrefs

Cf. A004754 (10), A004755 (11), A004756 (100), A004757 (101), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004758 n = a004758_list !! (n-1)
    a004758_list = 6 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004758_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 0}; Select[Range[5, 213], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* or *)
    Table[n + 5*2^Floor@ Log2@ n, {n, 53}] (* Michael De Vlieger, Aug 10 2016 *)
  • PARI
    a(n)=n+5*2^floor(log(n)/log(2))
    
  • Python
    def A004758(n): return n+(5<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 5*[n==0].
a(n) = n + 5 * 2^floor(log_2(n)) = A004757(n) + A053644(n).
a(2^m+k) = 6*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A004761 Numbers n whose binary expansion does not begin with 11.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 11, 16, 17, 18, 19, 20, 21, 22, 23, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 128, 129
Offset: 1

Views

Author

Keywords

Crossrefs

Apart from initial terms, same as A004754.

Programs

  • Maple
    f:= proc(n) option remember; if n::odd then procname(n-1)+1 else 2*procname(n/2+1) fi
    end proc:
    f(1):= 0: f(2):= 1:
    map(f, [$1..100]); # Robert Israel, Mar 31 2017
  • Mathematica
    Select[Range[0, 140], # <= 2 || Take[IntegerDigits[#, 2], 2] != {1, 1} &] (* Michael De Vlieger, Aug 03 2016 *)
  • PARI
    is(n)=n^2==n || !binary(n)[2] \\ Charles R Greathouse IV, Mar 07 2013
    
  • PARI
    a(n) = if(n<=2,n-1, n-=2; n + 1<Kevin Ryde, Apr 14 2021
    
  • Python
    def A004761(n): return m+(1<Chai Wah Wu, Jul 26 2023
  • R
    maxrow <- 8 # by choice
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01,rep(1,2^(m+1))); b01[2^(m+1):(2^(m+1)+2^m-1)] <- 0
    }
    (a <- c(0,1,which(b01 == 0)))
    # Yosu Yurramendi, Mar 30 2017
    

Formula

a(1)=0, a(2)=1 and for k>1: a(2*k-1) = a(2*k-2)+1, a(2*k) = 2*a(k+1). - Reinhard Zumkeller, Jan 09 2002, corrected by Robert Israel, Mar 31 2017
For n > 0, a(n) = 1/2 * (4n - 3 - A006257(n-1)). - Ralf Stephan, Sep 16 2003
a(1) = 0, a(2) = 1, a(2^m+k+2) = 2^(m+1)+k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Jul 30 2016
a(2^m+k) = A004760(2^m+k) - 2^m, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016
G.f. g(x) satisfies g(x) = 2*(1+x)*g(x^2)/x^2 - x^2*(1-x^2-x^3)/(1-x^2). - Robert Israel, Mar 31 2017

A080166 Primes having initial digits "11" in binary representation.

Original entry on oeis.org

3, 7, 13, 29, 31, 53, 59, 61, 97, 101, 103, 107, 109, 113, 127, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 769, 773, 787, 797, 809, 811, 821
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 03 2003

Keywords

Comments

Also primes that terminate at 3,2,1 in the x-1 problem: Repeat, if x is even divide by 2 else subtract 1, until 3 is reached. - Cino Hilliard, Mar 27 2003
Or, primes in A004760. - Vladimir Shevelev, May 04 2009

Examples

			A000040(16)=53 -> '110101' therefore 53 is a term.
		

Crossrefs

Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7: A000040, A080165, A080166, A262286, A262284, A262287, A262285.
Column k=3 of A262365.

Programs

  • Mathematica
    Select[Prime[Range[200]],Take[IntegerDigits[#,2],2]=={1,1}&] (* Harvey P. Dale, Jul 30 2019 *)
  • PARI
    pxnm1(n,p) = { forprime(x=2,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p-1;); if(p1 == 3,break); ); if(p1 == 3,print1(x" ")) ) }

A159615 The slowest increasing sequence beginning with a(1)=2 such that a(n) and n are both odious or both not odious.

Original entry on oeis.org

2, 4, 5, 7, 9, 10, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 27, 29, 31, 33, 35, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 99, 101, 103, 105, 107, 109, 111
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009

Keywords

Examples

			If n=3, then k=1, j=0, therefore a(6)=(10*3-4*0)/3=10.
		

Crossrefs

Programs

  • Maple
    read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n),'odd') ) ; end:
    A159615 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:
    seq(A159615(n),n=1..120) ; # R. J. Mathar, Aug 17 2009
  • Mathematica
    odiousQ[n_] := OddQ[DigitCount[n, 2, 1]];
    a[1] = 2; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[FreeQ[Array[a, n-1], k] && odiousQ[n] && odiousQ[k] || !odiousQ[n] && !odiousQ[k], Return[k] ] ];
    Array[a, 80] (* Jean-François Alcover, Dec 10 2017 *)

Formula

For n>=1, a(n)=min{m>a(n-1): A010060(m)=A010060(n)}.
a(2n+1)=2a(n)+1.
a(2n)=3n+1+j,if n=2^k+j; a(2n)=(10n-4j)/3,if n=2^k+2^(k-1)+j, where 0<=j<=2^(k-1)-1.

Extensions

Edited and extended by R. J. Mathar, Aug 17 2009

A159619 Slowest increasing sequence beginning with 4 such that n and a(n) are either both evil or both odious.

Original entry on oeis.org

4, 7, 9, 11, 12, 15, 16, 19, 20, 23, 25, 27, 28, 31, 33, 35, 36, 39, 41, 43, 44, 47, 48, 51, 52, 55, 57, 59, 60, 63, 64, 67, 68, 71, 73, 75, 76, 79, 80, 83, 84, 87, 89, 91, 92, 95, 97, 99, 100, 103, 105, 107, 108, 111, 112, 115, 116, 119, 121, 123, 124, 127, 129, 131, 132, 135, 137
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009, Apr 27 2009, May 04 2009

Keywords

Comments

(i) Theorem: For every initial value a(1) > 4, a minimum index n exists such that the a(n) obtained from that initial value coincides with this sequence here. Thus there exist essentially two slowest increasing sequences with this type of evil/odious congruence: A159615 and this one here.
(ii) In connection with this theorem, one can generalize to slowest increasing sequences a_m(n), a_m(1)=m, which let n and a(n) be at the same time in or not in some increasing sequence c(n). (This sequence here is c = A000069, m=4.)
We define a rank r of c as the minimum value a_r(1) such that for sufficiently large n (n depending on m) all sequences a_m(n), m>r, coincide with a_r(n).
In particular, c(n)=A004760(n+1) has rank r=2, and A000069 has rank r=3.
The problems are: 1) to find a sequence of rank r >= 4; 2) to find the rank of primes or to prove that it does not exist (in case of which it could be defined as infinity).
There is a conjecture arising in Sequence Machine that a(n) = A026491(2+n)-1. This appears to be true: Here we start from on odious or evil number and apply a minimum number of van-Eck-Transforms (of A171898) to reach a value larger than a(n-1). The Dekking formula in A026491 says that A026491 is essentially a partial sum of the backward van-Eck-Transforms, and in a (vague) manner this seems to match.
- R. J. Mathar, Jun 24 2021

Crossrefs

Programs

  • Maple
    read("transforms") ; isA000069 := proc(n) option remember ; RETURN( type(wt(n), 'odd') ) ; end:
    A159619 := proc(n) option remember; if n = 1 then 4; else for a from procname(n-1)+1 do if isA000069(a) = isA000069(n) then RETURN(a) ; fi; od: fi; end:
    seq(A159619(n), n=1..120) ; # R. J. Mathar, Mar 25 2010
  • Mathematica
    a[n_] := 2 * n + If[EvenQ[n] || EvenQ[IntegerExponent[n+1, 2]], 3, 2]; Array[a, 100] (* Amiram Eldar, Aug 30 2024 *)
  • PARI
    a(n) = 2 * n + if(!(n % 2) || !(valuation(n+1, 2) % 2), 3, 2); \\ Amiram Eldar, Aug 30 2024

Formula

a(n) = 2n+3 if n*A007814(n+1) is even, and a(n) = 2n+2 otherwise.

Extensions

Edited and extended by R. J. Mathar, Mar 25 2010

A004756 Binary expansion starts 100.

Original entry on oeis.org

4, 8, 9, 16, 17, 18, 19, 32, 33, 34, 35, 36, 37, 38, 39, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153
Offset: 1

Views

Author

Keywords

Examples

			18 in binary is 10010, so 18 is in sequence.
		

Crossrefs

Cf. A004754 (10), A004755 (11), A004757 (101), A004758 (110), A004759 (111).

Programs

  • Haskell
    import Data.List (transpose)
    a004756 n = a004756_list !! (n-1)
    a004756_list = 4 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004756_list
    -- Reinhard Zumkeller, Dec 04 2015
    
  • Mathematica
    Select[Range[4, 153], Take[IntegerDigits[#, 2], 3] == {1, 0, 0} &] (* Michael De Vlieger, Aug 07 2016 *)
  • PARI
    a(n)=n+3*2^floor(log(n)/log(2))
    
  • Python
    def A004756(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 3*[n==0].
a(n) = n + 3 * 2^floor(log_2(n)) = A004755(n) + A053644(n).
a(2^m+k) = 2^(m+2) + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 07 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A144795 A positive integer n is included if every 1 in binary n is next to at least one other 1.

Original entry on oeis.org

3, 6, 7, 12, 14, 15, 24, 27, 28, 30, 31, 48, 51, 54, 55, 56, 59, 60, 62, 63, 96, 99, 102, 103, 108, 110, 111, 112, 115, 118, 119, 120, 123, 124, 126, 127, 192, 195, 198, 199, 204, 206, 207, 216, 219, 220, 222, 223, 224, 227, 230, 231, 236, 238, 239, 240, 243, 246
Offset: 1

Views

Author

Leroy Quet, Sep 21 2008

Keywords

Comments

n is included if A144790(n) >= 2.
A173024 is a subsequence. - Reinhard Zumkeller, Feb 07 2010

Crossrefs

Complement of A377169.

Programs

  • Maple
    isA144795 := proc(n) local bind,i ; bind := convert(n,base,2) ; for i from 1 to nops(bind) do if i = 1 then if op(i,bind) = 1 and op(i+1,bind) = 0 then RETURN(false) : fi; elif i = nops(bind) then if op(i,bind) = 1 and op(i-1,bind) = 0 then RETURN(false) : fi; else if op(i,bind) = 1 and op(i-1,bind) = 0 and op(i+1,bind) = 0 then RETURN(false) : fi; fi; od: RETURN(true) ; end: for n from 3 to 400 do if isA144795(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 29 2008
  • Mathematica
    Select[Range@ 250, AllTrue[Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 1 &]], # > 1 &] &] (* Michael De Vlieger, Aug 20 2017 *)

Extensions

Extended by R. J. Mathar, Sep 29 2008

A356844 Numbers k such that the k-th composition in standard order contains at least one 1. Numbers that are odd or whose binary expansion contains at least two adjacent 1's.

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 13, 14, 15, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 37, 38, 39, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 67, 69, 70, 71, 73, 75, 76, 77, 78, 79, 81, 83, 85, 86, 87
Offset: 1

Views

Author

Gus Wiseman, Sep 02 2022

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, 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.

Examples

			The terms, binary expansions, and standard compositions:
   1:       1  (1)
   3:      11  (1,1)
   5:     101  (2,1)
   6:     110  (1,2)
   7:     111  (1,1,1)
   9:    1001  (3,1)
  11:    1011  (2,1,1)
  12:    1100  (1,3)
  13:    1101  (1,2,1)
  14:    1110  (1,1,2)
  15:    1111  (1,1,1,1)
  17:   10001  (4,1)
  19:   10011  (3,1,1)
  21:   10101  (2,2,1)
  22:   10110  (2,1,2)
  23:   10111  (2,1,1,1)
  24:   11000  (1,4)
  25:   11001  (1,3,1)
  26:   11010  (1,2,2)
  27:   11011  (1,2,1,1)
  28:   11100  (1,1,3)
  29:   11101  (1,1,2,1)
  30:   11110  (1,1,1,2)
  31:   11111  (1,1,1,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
The case beginning with 1 is A004760, complement A004754.
The complement is A022340.
These compositions are counted by A099036, complement A212804.
The case covering an initial interval is A333217.
The gapless but non-initial version is A356843, unordered A356845.

Programs

  • Mathematica
    Select[Range[0,100],OddQ[#]||MatchQ[IntegerDigits[#,2],{_,1,1,_}]&]

Formula

Union of A005408 and A004780.

A004759 Binary expansion starts 111.

Original entry on oeis.org

7, 14, 15, 28, 29, 30, 31, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244
Offset: 1

Views

Author

Keywords

Comments

This is the minimal recursive sequence such that a(1)=7, A007814(a(n))= A007814(n) and A010060(a(n))=A010060(n). - Vladimir Shevelev, Apr 23 2009

Examples

			30 in binary is 11110, so 30 is in sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a004759 n = a004759_list !! (n-1)
    a004759_list = 7 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004759_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 1}; Select[Range[5, 244], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 10 2016 *)
    Sort[FromDigits[#,2]&/@(Flatten[Table[Join[{1,1,1},#]&/@Tuples[{1,0},n],{n,0,5}],1])] (* Harvey P. Dale, Sep 01 2016 *)
  • PARI
    a(n)=n+6*2^floor(log(n)/log(2))
    
  • Python
    def A004759(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 6[n==0].
a(n) = n + 6 * 2^floor(log_2(n)) = A004758(n) + A053644(n).
a(n+1) = min{m > a(n): A007814(m) = A007814(n+1) and A010060(m) = A010060(n+1)}. a(2^k) - a(2^k-1) = A103204(k+2), k >= 1. - Vladimir Shevelev, Apr 23 2009
a(2^m+k) = 7*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A280873 Numbers whose binary expansion does not begin 10 and does not contain 2 adjacent 0's; Ahnentafel numbers of X-chromosome inheritance of a male.

Original entry on oeis.org

0, 1, 3, 6, 7, 13, 14, 15, 26, 27, 29, 30, 31, 53, 54, 55, 58, 59, 61, 62, 63, 106, 107, 109, 110, 111, 117, 118, 119, 122, 123, 125, 126, 127, 213, 214, 215, 218, 219, 221, 222, 223, 234, 235, 237, 238, 239, 245, 246, 247, 250, 251, 253, 254, 255
Offset: 0

Views

Author

Floris Strijbos, Jan 09 2017

Keywords

Comments

The number of ancestors at generation m from whom a living individual may have received an X chromosome allele is F_m, the m-th term of the Fibonacci Sequence.
From Antti Karttunen, Oct 11 2017: (Start)
The starting offset is zero (with a(0) = 0) for the same reason that we have A003714(0) = 0. Indeed, b(n) = A054429(A003714(n)) for n >= 0 yields the terms of this sequence, but in different order.
A163511(a(n)) for n >= 0 gives a permutation of squarefree numbers (A005117). See also A277006.
(End)

Crossrefs

Intersection of A003754 and A004760.
Positions where A163511 obtains squarefree (A005117) values.
Cf. also A293437 (a subsequence).

Programs

  • Maple
    gen[0]:= {0,1,3}:
    gen[1]:= {6,7}:
    for n from 2 to 10 do
      gen[n]:= map(t -> 2*t+1, gen[n-1]) union
          map(t -> 2*t, select(type, gen[n-1],odd))
    od:
    sort(convert(`union`(seq(gen[i],i=0..10)),list)); # Robert Israel, Oct 11 2017
  • Mathematica
    male = {1, 3}; generations = 8;
    Do[x = male[[i - 1]]; If[EvenQ[x],
                              male = Append[ male,   2*x + 1] ,
                              male = Flatten[Append[male, {2*x, 2*x + 1}]]]
           , {i, 3, Fibonacci[generations + 1]}]; male
  • PARI
    isA003754(n) = { n=bitor(n, n>>1)+1; n>>=valuation(n, 2); (n==1); }; \\ After Charles R Greathouse IV's Feb 06 2017 code.
    isA004760(n) = (n<2 || (binary(n)[2])); \\ This function also from Charles R Greathouse IV, Sep 23 2012
    isA280873(n) = (isA003754(n) && isA004760(n));
    n=0; k=0; while(k <= 10946, if(isA280873(n),write("b280873.txt", k, " ", n);k=k+1); n=n+1;); \\ Antti Karttunen, Oct 11 2017
    
  • Python
    def A280873():
        yield 1
        for x in A280873():
            if ((x & 1) and (x > 1)):
                yield 2*x
            yield 2*x+1
    def take(n, g):
      '''Returns a list composed of the next n elements returned by generator g.'''
      z = []
      if 0 == n: return(z)
      for x in g:
        z.append(x)
        if n > 1: n = n-1
        else: return(z)
    take(120, A280873())
    # Antti Karttunen, Oct 11 2017, after the given Mathematica-code (by Floris Strijbos) and a similar generator-example for A003714 by David Eppstein (cf. "Self-recursive generators" link).

Formula

{a(n) : n >= 1} = {k >= 1 : A365538(A054429(k)) > 0}. - Peter Munn, Jan 22 2024

Extensions

a(0) = 0 prepended and more descriptive alternative name added by Antti Karttunen, Oct 11 2017
Previous Showing 11-20 of 39 results. Next