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 14 results. Next

A020988 a(n) = (2/3)*(4^n-1).

Original entry on oeis.org

0, 2, 10, 42, 170, 682, 2730, 10922, 43690, 174762, 699050, 2796202, 11184810, 44739242, 178956970, 715827882, 2863311530, 11453246122, 45812984490, 183251937962, 733007751850, 2932031007402, 11728124029610, 46912496118442, 187649984473770, 750599937895082
Offset: 0

Views

Author

Keywords

Comments

Numbers whose binary representation is 10, n times (see A163662(n) for n >= 1). - Alexandre Wajnberg, May 31 2005
Numbers whose base-4 representation consists entirely of 2's; twice base-4 repunits. - Franklin T. Adams-Watters, Mar 29 2006
Expected time to finish a random Tower of Hanoi problem with 2n disks using optimal moves, so (since 2n is even and A010684(2n) = 1) a(n) = A060590(2n). - Henry Bottomley, Apr 05 2001
a(n) is the number of derangements of [2n + 3] with runs consisting of consecutive integers. E.g., a(1) = 10 because the derangements of {1, 2, 3, 4, 5} with runs consisting of consecutive integers are 5|1234, 45|123, 345|12, 2345|1, 5|4|123, 5|34|12, 45|23|1, 345|2|1, 5|4|23|1, 5|34|2|1 (the bars delimit the runs). - Emeric Deutsch, May 26 2003
For n > 0, also smallest numbers having in binary representation exactly n + 1 maximal groups of consecutive zeros: A087120(n) = a(n-1), see A087116. - Reinhard Zumkeller, Aug 14 2003
Number of walks of length 2n + 3 between any two diametrically opposite vertices of the cycle graph C_6. Example: a(0) = 2 because in the cycle ABCDEF we have two walks of length 3 between A and D: ABCD and AFED. - Emeric Deutsch, Apr 01 2004
From Paul Barry, May 18 2003: (Start)
Row sums of triangle using cumulative sums of odd-indexed rows of Pascal's triangle (start with zeros for completeness):
0 0
1 1
1 4 4 1
1 6 14 14 6 1
1 8 27 49 49 27 8 1 (End)
a(n) gives the position of the n-th zero in A173732, i.e., A173732(a(n)) = 0 for all n and this gives all the zeros in A173732. - Howard A. Landman, Mar 14 2010
Smallest number having alternating bit sum -n. Cf. A065359. For n = 0, 1, ..., the last digit of a(n) is 0, 2, 0, 2, ... . - Washington Bomfim, Jan 22 2011
Number of toothpicks minus 1 in the toothpick structure of A139250 after 2^n stages. - Omar E. Pol, Mar 15 2012
For n > 0 also partial sums of the odd powers of 2 (A004171). - K. G. Stier, Nov 04 2013
Values of m such that binomial(4*m + 2, m) is odd. Cf. A002450. - Peter Bala, Oct 06 2015
For a(n) > 2, values of m such that m is two steps away from a power of 2 under the Collatz iteration. - Roderick MacPhee, Nov 10 2016
a(n) is the position of the first occurrence of 2^(n+1)-1 in A020986. See the Brillhart and Morton link, pp. 856-857. - John Keith, Jan 12 2021
a(n) is the number of monotone paths in the n-dimensional cross-polytope for a generic linear orientation. See the Black and De Loera link. - Alexander E. Black, Feb 15 2023

Crossrefs

Programs

Formula

a(n) = 4*a(n-1) + 2, a(0) = 0.
a(n) = A026644(2*n).
a(n) = A007583(n) - 1 = A039301(n+1) - 2 = A083584(n-1) + 1.
E.g.f. : (2/3)*(exp(4*x)-exp(x)). - Paul Barry, May 18 2003
a(n) = A007583(n+1) - 1 = A039301(n+2) - 2 = A083584(n) + 1. - Ralf Stephan, Jun 14 2003
G.f.: 2*x/((1-x)*(1-4*x)). - R. J. Mathar, Sep 17 2008
a(n) = a(n-1) + 2^(2n-1), a(0) = 0. - Washington Bomfim, Jan 22 2011
a(n) = A193652(2*n). - Reinhard Zumkeller, Aug 08 2011
a(n) = 5*a(n-1) - 4*a(n-2) (n > 1), a(0) = 0, a(1) = 2. - L. Edson Jeffery, Mar 02 2012
a(n) = (2/3)*A024036(n). - Omar E. Pol, Mar 15 2012
a(n) = 2*A002450(n). - Yosu Yurramendi, Jan 24 2017
From Seiichi Manyama, Nov 24 2017: (Start)
Zeta_{GL(2)/F_1}(s) = Product_{k = 1..4} (s-k)^(-b(2,k)), where Sum b(2,k)*t^k = t*(t-1)*(t^2-1). That is Zeta_{GL(2)/F_1}(s) = (s-3)*(s-2)/((s-4)*(s-1)).
Zeta_{GL(2)/F_1}(s) = Product_{n > 0} (1 - (1/s)^n)^(-A295521(n)) = Product_{n > 0} (1 - x^n)^(-A295521(n)) = (1-3*x)*(1-2*x)/((1-4*x)*(1-x)) = 1 + Sum_{k > 0} a(k-1)*x^k (x=1/s). (End)
From Oboifeng Dira, May 29 2020: (Start)
a(n) = A078008(2n+1) (second bisection).
a(n) = Sum_{k=0..n} binomial(2n+1, ((n+2) mod 3)+3k). (End)
From John Reimer Morales, Aug 04 2025: (Start)
a(n) = A000302(n) - A047849(n).
a(n) = A020522(n) + A000079(n) - A047849(n). (End)

Extensions

Edited by N. J. A. Sloane, Sep 06 2006

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

A033264 Number of blocks of {1,0} in the binary expansion of n.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2
Offset: 1

Views

Author

Keywords

Comments

Number of i such that d(i) < d(i-1), where Sum_{d(i)*2^i: i=0,1,....,m} is base 2 representation of n.
This is the base-2 down-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

Crossrefs

a(n) = A005811(n) - ceiling(A005811(n)/2) = A005811(n) - A069010(n).
Equals (A072219(n+1)-1)/2.
Cf. also A175047, A030308.
Essentially the same as A087116.

Programs

  • Haskell
    a033264 = f 0 . a030308_row where
       f c [] = c
       f c (0 : 1 : bs) = f (c + 1) bs
       f c (_ : bs) = f c bs
    -- Reinhard Zumkeller, Feb 20 2014, Jun 17 2012
    
  • Maple
    f:= proc(n) option remember; local k;
    k:= n mod 4;
    if k = 2 then procname((n-2)/4) + 1
    elif k = 3 then procname((n-3)/4)
    else procname((n-k)/2)
    fi
    end proc:
    f(1):= 0: f(0):= q:
    seq(f(i),i=1..100); # Robert Israel, Aug 31 2015
  • Mathematica
    Table[Count[Partition[IntegerDigits[n, 2], 2, 1], {1, 0}], {n, 102}] (* Michael De Vlieger, Aug 31 2015, after Robert G. Wilson v at A014081 *)
    Table[SequenceCount[IntegerDigits[n,2],{1,0}],{n,110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2017 *)
  • PARI
    a(n) = { hammingweight(bitand(n>>1, bitneg(n))) }; \\ Gheorghe Coserea, Aug 30 2015
    
  • Python
    def A033264(n): return ((n>>1)&~n).bit_count() # Chai Wah Wu, Jun 25 2025

Formula

G.f.: 1/(1-x) * Sum_(k>=0, t^2/(1+t)/(1+t^2), t=x^2^k). - Ralf Stephan, Sep 10 2003
a(n) = A069010(n) - (n mod 2). - Ralf Stephan, Sep 10 2003
a(4n) = a(4n+1) = a(2n), a(4n+2) = a(n)+1, a(4n+3) = a(n). - Ralf Stephan, Aug 20 2003
a(n) = A087116(n) for n > 0, since strings of 0's alternate with strings of 1's, which end in (1,0). - Jonathan Sondow, Jan 17 2016
Sum_{n>=1} a(n)/(n*(n+1)) = Pi/4 - log(2)/2 (A196521) (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021

A087117 Number of zeros in the longest string of consecutive zeros in the binary representation of n.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 1, 0, 3, 2, 1, 1, 2, 1, 1, 0, 4, 3, 2, 2, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 0, 5, 4, 3, 3, 2, 2, 2, 2, 3, 2, 1, 1, 2, 1, 1, 1, 4, 3, 2, 2, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 0, 6, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 4, 3, 2, 2, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 4, 3, 3, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 14 2003

Keywords

Comments

The following four statements are equivalent: a(n) = 0; n = 2^k - 1 for some k > 0; A087116(n) = 0; A023416(n) = 0.
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. Then a(k) is the maximum part of this composition, minus one. The maximum part is A333766(k). - Gus Wiseman, Apr 09 2020

Crossrefs

Positions of zeros are A000225.
Positions of terms <= 1 are A003754.
Positions of terms > 0 are A062289.
Positions of first appearances are A131577.
The version for prime indices is A252735.
The proper maximum is A333766.
The version for minimum is A333767.
Maximum prime index is A061395.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Runs-resistance is A333628.
- Weakly decreasing compositions are A114994.
- Weakly increasing compositions are A225620.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.

Programs

  • Haskell
    import Data.List (unfoldr, group)
    a087117 0       = 1
    a087117 n
      | null $ zs n = 0
      | otherwise   = maximum $ map length $ zs n where
      zs = filter ((== 0) . head) . group .
           unfoldr (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2)
    -- Reinhard Zumkeller, May 01 2012
    
  • Maple
    A087117 := proc(n)
        local d,l,zlen ;
        if n = 0 then
            return 1 ;
        end if;
        d := convert(n,base,2) ;
        for l from nops(d)-1 to 0 by -1 do
            zlen := [seq(0,i=1..l)] ;
            if verify(zlen,d,'sublist') then
                return l ;
            end if;
        end do:
        return 0 ;
    end proc; # R. J. Mathar, Nov 05 2012
  • Mathematica
    nz[n_]:=Max[Length/@Select[Split[IntegerDigits[n,2]],MemberQ[#,0]&]]; Array[nz,110,0]/.-\[Infinity]->0 (* Harvey P. Dale, Sep 05 2017 *)
  • PARI
    h(n)=if(n<2, return(0)); my(k=valuation(n,2)); if(k, max(h(n>>k), k), n++; n>>=valuation(n,2); h(n-1))
    a(n)=if(n,h(n),1) \\ Charles R Greathouse IV, Apr 06 2022

Formula

a(n) = max(A007814(n), a(A025480(n-1))) for n >= 2. - Robert Israel, Feb 19 2017
a(2n+1) = a(n) (n>=1); indeed, the binary form of 2n+1 consists of the binary form of n with an additional 1 at the end - Emeric Deutsch, Aug 18 2017
For n > 0, a(n) = A333766(n) - 1. - Gus Wiseman, Apr 09 2020

A278219 Filter-sequence related to base-2 run-length encoding: a(n) = A046523(A243353(n)).

Original entry on oeis.org

1, 2, 4, 2, 4, 8, 6, 2, 4, 12, 16, 8, 6, 12, 6, 2, 4, 12, 36, 12, 16, 32, 24, 8, 6, 30, 24, 12, 6, 12, 6, 2, 4, 12, 36, 12, 36, 72, 60, 12, 16, 48, 64, 32, 24, 72, 24, 8, 6, 30, 60, 30, 24, 48, 60, 12, 6, 30, 24, 12, 6, 12, 6, 2, 4, 12, 36, 12, 36, 72, 60, 12, 36, 180, 144, 72, 60, 180, 60, 12, 16, 48, 144, 48, 64, 128, 96, 32, 24, 120, 216, 72, 24, 72
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Crossrefs

Other base-2 related filter sequences: A278217, A278222.
Sequences that (seem to) partition N into same or coarser equivalence classes are at least these: A005811, A136004, A033264, A037800, A069010, A087116, A090079 and many others like A105500, A106826, A166242, A246960, A277561, A037834, A225081 although these have not been fully checked yet.

Programs

  • Mathematica
    f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; g[n_] := If[n == 1, 1, Times @@ MapIndexed[ Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]];
    Table[g@ f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, 93}] (* Michael De Vlieger, May 09 2017 *)
  • Python
    from sympy import prime, factorint
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a003188(n): return n^int(n/2)
    def a243353(n): return a005940(1 + a003188(n))
    def a(n): return a046523(a243353(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A278219 n) (A046523 (A243353 n)))
    

Formula

a(n) = A046523(A243353(n)).
a(n) = A278222(A003188(n)).
a(n) = A278220(1+A075157(n)).

A106151 In binary representation of n: delete one zero in each contiguous block of zeros.

Original entry on oeis.org

1, 1, 3, 2, 3, 3, 7, 4, 5, 3, 7, 6, 7, 7, 15, 8, 9, 5, 11, 6, 7, 7, 15, 12, 13, 7, 15, 14, 15, 15, 31, 16, 17, 9, 19, 10, 11, 11, 23, 12, 13, 7, 15, 14, 15, 15, 31, 24, 25, 13, 27, 14, 15, 15, 31, 28, 29, 15, 31, 30, 31, 31, 63, 32, 33, 17, 35, 18, 19, 19, 39, 20, 21, 11, 23, 22, 23
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2005

Keywords

Comments

Equivalently, change bits 10 -> 0. - Michael S. Branicky, Nov 12 2021

Examples

			n=144 = '10010000' -> '101000' = 40 = a(144);
n=145 = '10010001' -> '101001' = 41 = a(145);
n=146 = '10010010' -> '10101'  = 21 = a(146).
		

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a106151 = foldr (\b v -> 2 * v + b) 0 . concatMap
       (\bs'@(b:bs) -> if b == 0 then bs else bs') . group . a030308_row
    -- Reinhard Zumkeller, Jul 05 2013
    
  • PARI
    A106151(n) = if(n<=1, n, if(n%2, 1+(2*A106151((n-1)/2)), A106151(n>>valuation(n, 2))<<(valuation(n, 2)-1))); \\ Antti Karttunen, May 13 2018
    
  • PARI
    A106151(n) = { my(s=0, i=0); while(n, if(2!=(n%4), s += (n%2)<>= 1); (s); }; \\ Antti Karttunen, Jul 01 2024
    
  • Python
    def a(n): return int(bin(n).replace("b", "").replace("10", "1"), 2)
    print([a(n) for n in range(1, 78)]) # Michael S. Branicky, Nov 12 2021

Formula

a(n) <= n; a(n) = n iff n = 2^k-1: a(A000225(n))=A000225(n);
A000120(a(n)) = A000120(n);
A023416(a(n)) = A023416(n) - A087116(n).
a(n) = b(n, 0), where b(n, r) = if n = 1 then 1 else b(floor(n/2), 1 - n mod 2)*(1 + floor((1 + r + n mod 2)/2)) + n mod 2.
For n <= 1, a(n) = n, and for n > 1, if n is odd, then a(n) = 1+2*a((n-1)/2), otherwise, when n is even, a(n) = (2^(A007814(n)-1)) * a(A000265(n)). - Antti Karttunen, May 13 2018

A087118 Numbers having exactly one maximal group of consecutive zeros in binary representation of n.

Original entry on oeis.org

0, 2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 23, 24, 25, 27, 28, 29, 30, 32, 33, 35, 39, 47, 48, 49, 51, 55, 56, 57, 59, 60, 61, 62, 64, 65, 67, 71, 79, 95, 96, 97, 99, 103, 111, 112, 113, 115, 119, 120, 121, 123, 124, 125, 126, 128, 129, 131, 135, 143, 159, 191
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 14 2003

Keywords

Comments

A087116(a(n)) = 1.
a(n) = A043687(n-1) for 1 < n < 1000. - Georg Fischer, Oct 19 2018

Crossrefs

Programs

  • Maple
    0, seq(seq(seq(2^n - 2^b + 2^a - 1, a=0..b-1),b=n-1..1,-1),n=0..10); # Robert Israel, Oct 01 2015
  • Mathematica
    Table[2^n - 2^b + 2^a - 1, {n, 0, 10}, {b, n-1, 1, -1}, {a, 0, b-1}] // Flatten // Prepend[#, 0]& (* Jean-François Alcover, Apr 11 2019, after  Robert Israel *)
  • PARI
    num(a,b,c) = (1 << (a+b+c)) - (1 << (b+c)) + (1 << c)  - 1;
    succ(a,b,c) = {
        if (b > 1, return([a, b-1, c+1]));
        if (c > 0, return([a+1, c, 0]));
        return([1, a+1, 0]);
    };
    seq(n) = {
        my(a = 1, b = 1, c = 0, v = vector(n));
        for (i = 2, n, v[i] = num(a,b,c);
             my(x = succ(a,b,c)); a = x[1]; b = x[2]; c = x[3]);
        return(v);
    };
    seq(64)  \\ Gheorghe Coserea, Sep 28 2015

Formula

From Gheorghe Coserea, Sep 28-30 2015: (Start)
a((n^3 - n)/6 + 2) = 2^n for n >= 1.
a((n^3 - n)/6 + 2 + n) = 2^n + 2^(n-1) for n >= 2.
a((n^3 - n)/6 + 2 + n + n-1) = 2^n + 2^(n-1) + 2^(n-2) for n >= 3.
a(n) < 2*2^((6*n)^(1/3)) and limsup a(n)/2^((6*n)^(1/3)) = 2.
a(n) > 1/2 * 2^((6*n)^(1/3)) for n>=3 and 1/2 <= liminf a(n)/(2^((6*n)^(1/3))) <= 1.
(End)

A107345 From the binary representation of n: binomial(number of zeros, number of blocks of contiguous zeros).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 3, 3, 2, 3, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 5, 4, 6, 3, 6, 3, 3, 2, 6, 3, 1, 1, 3, 1, 1, 1, 4, 3, 3, 2, 3, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 6, 5, 10, 4, 10, 6, 6, 3, 10, 6, 4, 3, 6, 3, 3, 2, 10, 6, 4, 3, 4, 1, 1, 1, 6, 3, 1, 1, 3, 1, 1, 1, 5, 4, 6, 3, 6, 3, 3
Offset: 0

Views

Author

Reinhard Zumkeller, May 23 2005

Keywords

Comments

a(n) = binomial(A023416(n), A087116(n)); a(A003754(n)) = 1.
First occurrence of k: 1, 4, 8, 16, 32, 34, 128, 256, 512, 66, 2048, 4096, 8192, 16384, 130, 65536, 131072, 262144, 524288, 266, 258, ..., . k must occur by 2^k. - Robert G. Wilson v
Record values: 1, 4, 8, 16, 32, 34, 66, 130, 258, 514, 522, 1026, 1034, 2058, 4106, 4138, 8202, 8234, 16394, 16426, 32810, 65578, 65706, 131114, 131242, 262186, 262314, 524458, 1048746, 1049258, 2097322, 2097834, 4194474, 4194986, 8389290, 8391338, ..., . - Robert G. Wilson v

Crossrefs

Programs

  • Haskell
    a107345 n = a007318' (a023416 n) (a087116 n)
    -- Reinhard Zumkeller, Mar 31 2015
  • Mathematica
    f[n_] := Block[{id = IntegerDigits[n, 2]}, Binomial[ Count[id, 0], Floor[(Length@ Split@ id + 1)/2]]]; Table[f@n, {n, 0, 102}] (* Robert G. Wilson v, Apr 01 2008 *)

A107686 If n=0 then 0 else smallest number greater than its predecessor and having in binary representation less zeros or more blocks of contiguous zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 23, 26, 27, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 47, 50, 51, 52, 53, 55, 58, 59, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 79, 80, 81, 82, 83, 84, 85, 87, 90, 91, 95, 98, 99, 100, 101, 103, 104, 105
Offset: 0

Views

Author

Reinhard Zumkeller, May 20 2005

Keywords

Comments

A023416(a(n+1)) < A023416(a(n)) or A087116(a(n+1))>A087116(a(n));
complement of A107687; A107688(n) = a(n+1) - a(n);
A107684 is a subsequence.

Crossrefs

Cf. A007088.

A107782 In binary representation of n: (number of zeros) minus (number of blocks of contiguous zeros).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 5, 4, 3, 3, 3, 2, 2, 2, 3, 2, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 2, 1, 1, 1, 2
Offset: 0

Views

Author

Reinhard Zumkeller, May 25 2005

Keywords

Comments

a(n) = A023416(n) - A087116(n); a(A003754(n)) = 0.

Crossrefs

Cf. A056973. - R. J. Mathar, Aug 24 2008

Programs

Showing 1-10 of 14 results. Next