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

A104326 Dual Zeckendorf representation of n or the maximal (binary) Fibonacci representation. Also list of binary vectors not containing 00.

Original entry on oeis.org

0, 1, 10, 11, 101, 110, 111, 1010, 1011, 1101, 1110, 1111, 10101, 10110, 10111, 11010, 11011, 11101, 11110, 11111, 101010, 101011, 101101, 101110, 101111, 110101, 110110, 110111, 111010, 111011, 111101, 111110, 111111, 1010101
Offset: 0

Views

Author

Ron Knott, Mar 01 2005

Keywords

Comments

Whereas the Zeckendorf (binary) rep (A014417) has no consecutive 1's (no two consecutive Fibonacci numbers in a set whose sum is n), the Dual Zeckendorf Representation has no consecutive 0's. Also called the Maximal (Binary) Fibonacci Representation, the Zeckendorf rep. being the Minimal in terms of number of 1's in the binary representation.
Also known as the lazy Fibonacci representation of n. - Glen Whitney, Oct 21 2017

Examples

			As a sum of Fibonacci numbers (A000045) [using 1 at most once], 13 is 13=8+5=8+3+2.
The largest set here is 8+3+2 or, in base Fibonacci, 10110 so a(13)=10110(fib).
The Zeckendorf representation would be the smallest set or {13}=100000(fib).
		

Crossrefs

Cf. A007088 (binary vectors), A014417, A095791, A104324.
A003754 gives the numbers corresponding to the binary digit strings seen here.

Programs

  • Maple
    dualzeckrep:=proc(n)local i,z;z:=zeckrep(n);i:=1; while i<=nops(z)-2 do if z[i]=1 and z[i+1]=0 and z[i+2]=0 then z[i]:=0; z[i+1]:=1;z[i+2]:=1; if i>3 then i:=i-2 fi else i:=i+1 fi od; if z[1]=0 then z:=subsop(1=NULL,z) fi; z end proc: seq(dualzeckrep(n),n=0..20) ;
    # alternative
    A104326 := proc(n)
        local L,itr,rec,i ;
        # first compute the usual Zeckendorf rep as in A014417
        L := convert(A014417(n),base,10) ;
        for itr from 1 do
            rec := false ;
            # try to recombine 001 -> 110
            for i from 3 to nops(L) do
                if op(i,L) = 1 and op(i-1,L) =0 and op(i-2,L) =0 then
                    rec := true ;
                    L := subsop(i=0,L) ;
                    L := subsop(i-1=1,L) ;
                    L := subsop(i-2=1,L) ;
                end if;
            end do:
            if op(-1,L) = 0 then
                L := subsop(-1=NULL,L) ;
            end if;
            if rec = false then
                break ;
            end if;
        end do:
        add( op(i,L)*10^(i-1),i=1..nops(L)) ;
    end proc:
    seq(A104326(n),n=0..20) ; # R. J. Mathar, Aug 28 2025
  • Mathematica
    fb[n_] := Module[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; fr]; a[n_] := Module[{v = fb[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i]] == 1 && v[[i + 1]] == 0 && v[[i + 2]] == 0, v[[i]] = 0; v[[i + 1]] = 1; v[[i + 2]] = 1; If[i > 2, i -= 3]]; i++]; i = Position[v, ?(# > 0 &)]; If[i == {}, 0, FromDigits[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 34, 0] (* _Amiram Eldar, Oct 31 2019 after Robert G. Wilson v at A014417 and the Maple code *)
    Map[FromDigits, Select[IntegerString[Range[0, 255], 2], StringFreeQ[#, "00"] &]] (* Paolo Xausa, Apr 05 2024 *)

Formula

a(n) = A007088(A003754(n+1)).

Extensions

Index in formula corrected, missing parts of the maple code recovered, and sequence extended by R. J. Mathar, Oct 23 2010
Definition expanded and Duchêne, Fraenkel et al. reference added by N. J. A. Sloane, Aug 07 2018

A022290 Replace 2^k in binary expansion of n with Fibonacci(k+2).

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			n=4 = 2^2 is replaced by A000045(2+2) = 3. n=5 = 2^2 + 2^0 is replaced by A000045(2+2) + A000045(0+2) = 3+1 = 4. - _R. J. Mathar_, Jan 31 2015
From _Philippe Deléham_, Jun 05 2015: (Start)
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
  0
  1
  2, 3
  3, 4, 5, 6
  5, 6, 7, 8, 8, 9, 10, 11
  8, 9, 10, 11, 11, 12, 13, 14, 13, 14, 15, 16, 16, 17, 18, 19
  ...
(End)
		

Crossrefs

Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A054204 (even-indexed Fibonacci numbers), A062877 (odd-indexed Fibonacci numbers), A059590 (factorials), A089625 (primes).

Programs

  • Haskell
    a022290 0 = 0
    a022290 n = h n 0 $ drop 2 a000045_list where
       h 0 y _      = y
       h x y (f:fs) = h x' (y + f * r) fs where (x',r) = divMod x 2
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A022290 := proc(n)
        dgs := convert(n,base,2) ;
        add( op(i,dgs)*A000045(i+1),i=1..nops(dgs)) ;
    end proc: # R. J. Mathar, Jan 31 2015
    # second Maple program:
    b:= (n, i, j)-> `if`(n=0, 0, j*irem(n, 2, 'q')+b(q, j, i+j)):
    a:= n-> b(n, 1$2):
    seq(a(n), n=0..127);  # Alois P. Heinz, Jan 26 2022
  • Mathematica
    Table[Reverse[#].Fibonacci[1 + Range[Length[#]]] &@ IntegerDigits[n, 2], {n, 0, 54}] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
  • PARI
    my(m=Mod('x,'x^2-'x-1)); a(n) = subst(lift(subst(Pol(binary(n)), 'x,m)), 'x,2); \\ Kevin Ryde, Sep 22 2020
    
  • Python
    def A022290(n):
        a, b, s = 1,2,0
        for i in bin(n)[-1:1:-1]:
            s += int(i)*a
            a, b = b, a+b
        return s # Chai Wah Wu, Sep 10 2022

Formula

G.f.: (1/(1-x)) * Sum_{k>=0} F(k+2)*x^2^k/(1+x^2^k), where F = A000045.
a(n) = Sum_{k>=0} A030308(n,k)*A000045(k+2). - Philippe Deléham, Oct 15 2011
a(A003714(n)) = n. - R. J. Mathar, Jan 31 2015
a(A000225(n)) = A001911(n). - Philippe Deléham, Jun 05 2015
From Jeffrey Shallit, Jul 17 2018: (Start)
Can be computed from the recurrence:
a(4*k) = a(k) + a(2*k),
a(4*k+1) = a(k) + a(2*k+1),
a(4*k+2) = a(k) - a(2*k) + 2*a(2*k+1),
a(4*k+3) = a(k) - 2*a(2*k) + 3*a(2*k+1),
and the initial terms a(0) = 0, a(1) = 1. (End)
a(A003754(n)) = n-1. - Rémy Sigrist, Jan 28 2020
From Rémy Sigrist, Aug 04 2022: (Start)
Empirically:
- a(2*A003714(n)) = A022342(n+1),
- a(3*A003714(n)) = a(4*A003714(n)) = A026274(n) for n > 0.
(End)

A333766 Maximum part of the n-th composition in standard order. a(0) = 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 05 2020

Keywords

Comments

One plus the longest run of 0's in the binary expansion of n.
A composition of n is a finite sequence of positive integers summing to n. 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.

Examples

			The 100th composition in standard order is (1,3,3), so a(100) = 3.
		

Crossrefs

Positions of ones are A000225.
Positions of terms <= 2 are A003754.
The version for prime indices is A061395.
Positions of terms > 1 are A062289.
Positions of first appearances are A131577.
The minimum part is given by A333768.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without 1's are A022340.
- Sum is A070939.
- Product is A124758.
- 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

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[If[n==0,0,Max@@stc[n]],{n,0,100}]

Formula

For n > 0, a(n) = A087117(n) + 1.

A003726 Numbers with no 3 adjacent 1's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 54, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 80, 81, 82
Offset: 1

Views

Author

Keywords

Comments

Positions of zeros in A014082. Could be called "tribbinary numbers" by analogy with A003714. - John Keith, Mar 07 2022
The sequence of Tribbinary numbers can be constructed by writing out the Tribonacci representations of nonnegative integers and then evaluating the result in binary. These numbers are similar to Fibbinary numbers A003714, Fibternary numbers A003726, and Tribternary numbers A356823. The number of Tribbinary numbers less than any power of two is a Tribonacci number. We can generate Tribbinary numbers recursively: Start by adding 0 and 1 to the sequence. Then, if x is a number in the sequence add 2x, 4x+1, and 8x+3 to the sequence. The n-th Tribbinary number is even if the n-th term of the Tribonacci word is a. Respectively, the n-th Tribbinary number is of the form 4x+1 if the n-th term of the Tribonacci word is b, and the n-th Tribbinary number is of the form 8x+3 if the n-th term of the Tribonacci word is c. Every nonnegative integer can be written as the sum of two Tribbinary numbers. Every number has a Tribbinary multiple. - Tanya Khovanova and PRIMES STEP Senior, Aug 30 2022

Crossrefs

Cf. A278038 (binary), A063037, A000073, A014082 (number of 111).
Cf. A004781 (complement).
Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110).

Programs

  • Haskell
    a003726 n = a003726_list !! (n - 1)
    a003726_list = filter f [0..] where
       f x = x < 7 || (x `mod` 8) < 7 && f (x `div` 2)
    -- Reinhard Zumkeller, Jun 03 2012
    
  • Mathematica
    Select[Range[0, 82], SequenceCount[IntegerDigits[#, 2], {1, 1, 1}] == 0 &] (* Michael De Vlieger, Dec 23 2019 *)
  • PARI
    is(n)=!bitand(bitand(n, n<<1), n<<2) \\ Charles R Greathouse IV, Feb 11 2017

Formula

There are A000073(n+3) terms of this sequence with at most n bits. In particular, a(A000073(n+3)+1) = 2^n. - Charles R Greathouse IV, Oct 22 2021
Sum_{n>=2} 1/a(n) = 9.516857810319139410424631558212354346868048230248717360943194590798113163384... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 13 2022

A022340 Even Fibbinary numbers (A003714); also 2*Fibbinary(n).

Original entry on oeis.org

0, 2, 4, 8, 10, 16, 18, 20, 32, 34, 36, 40, 42, 64, 66, 68, 72, 74, 80, 82, 84, 128, 130, 132, 136, 138, 144, 146, 148, 160, 162, 164, 168, 170, 256, 258, 260, 264, 266, 272, 274, 276, 288, 290, 292, 296, 298, 320, 322, 324, 328, 330, 336, 338, 340, 512
Offset: 0

Views

Author

Keywords

Comments

Positions of ones in binomial(3k+2,k+1)/(3k+2) modulo 2 (A085405). - Paul D. Hanna, Jun 29 2003
Construction: start with strings S(0)={0}, S(1)={2}; for k>=2, concatenate all prior strings excluding S(k-1) and add 2^k to each element in the resulting string to obtain S(k); this sequence is the concatenation of all such generated strings: {S(0),S(1),S(2),...}. Example: for k=5, concatenate {S(0),S(1),S(2),S(3)} = {0, 2, 4, 8,10}; add 2^5 to each element to obtain S(5)={32,34,38,40,42}. - Paul D. Hanna, Jun 29 2003
From Gus Wiseman, Apr 08 2020: (Start)
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 ones. For example, the sequence together with the corresponding compositions begins:
0: () 80: (2,5) 260: (6,3)
2: (2) 82: (2,3,2) 264: (5,4)
4: (3) 84: (2,2,3) 266: (5,2,2)
8: (4) 128: (8) 272: (4,5)
10: (2,2) 130: (6,2) 274: (4,3,2)
16: (5) 132: (5,3) 276: (4,2,3)
18: (3,2) 136: (4,4) 288: (3,6)
20: (2,3) 138: (4,2,2) 290: (3,4,2)
32: (6) 144: (3,5) 292: (3,3,3)
34: (4,2) 146: (3,3,2) 296: (3,2,4)
36: (3,3) 148: (3,2,3) 298: (3,2,2,2)
40: (2,4) 160: (2,6) 320: (2,7)
42: (2,2,2) 162: (2,4,2) 322: (2,5,2)
64: (7) 164: (2,3,3) 324: (2,4,3)
66: (5,2) 168: (2,2,4) 328: (2,3,4)
68: (4,3) 170: (2,2,2,2) 330: (2,3,2,2)
72: (3,4) 256: (9) 336: (2,2,5)
74: (3,2,2) 258: (7,2) 338: (2,2,3,2)
(End)

Crossrefs

Equals 2 * A003714.
Compositions with no ones are counted by A212804.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without terms > 2 are A003754.
- Compositions without ones are A022340 (this sequence).
- Sum is A070939.
- Compositions with no twos are A175054.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Runs-resistance is A333628.

Programs

  • Haskell
    a022340 = (* 2) . a003714 -- Reinhard Zumkeller, Feb 03 2015
    
  • Mathematica
    f[n_Integer] := Block[{k = Ceiling[ Log[ GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k-- ]; FromDigits[fr, 2]]; Select[f /@ Range[0, 95], EvenQ[ # ] &] (* Robert G. Wilson v, Sep 18 2004 *)
    Select[Range[2, 512, 2], BitAnd[#, 2#] == 0 &] (* Alonso del Arte, Jun 18 2012 *)
  • Python
    from itertools import count, islice
    def A022340_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:not n&(n>>1),count(max(0,startvalue+(startvalue&1)),2))
    A022340_list = list(islice(A022340_gen(),30)) # Chai Wah Wu, Sep 07 2022
    
  • Python
    def A022340(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d <= n:
                s += 1
                n -= d
            s <<= 1
        return s # Chai Wah Wu, Apr 24 2025

Formula

For n>0, a(F(n))=2^n, a(F(n)-1)=A001045(n+2)-1, where F(n) is the n-th Fibonacci number with F(0)=F(1)=1.
a(n) + a(n)/2 = a(n) XOR a(n)/2, see A106409. - Reinhard Zumkeller, May 02 2005

Extensions

Edited by Ralf Stephan, Sep 01 2004

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

A107907 Numbers having consecutive zeros or consecutive ones in binary representation.

Original entry on oeis.org

3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Reinhard Zumkeller, May 28 2005

Keywords

Comments

Also positive integers whose binary expansion has cuts-resistance > 1. For the operation of shortening all runs by 1, cuts-resistance is the number of applications required to reach an empty word. - Gus Wiseman, Nov 27 2019

Examples

			From _Gus Wiseman_, Nov 27 2019: (Start)
The sequence of terms together with their binary expansions begins:
    3:      11
    4:     100
    6:     110
    7:     111
    8:    1000
    9:    1001
   11:    1011
   12:    1100
   13:    1101
   14:    1110
   15:    1111
   16:   10000
   17:   10001
   18:   10010
(End)
		

Crossrefs

Union of A003754 and A003714.
Complement of A000975.

Programs

  • Mathematica
    Select[Range[100],MatchQ[IntegerDigits[#,2],{_,x_,x_,_}]&] (* Gus Wiseman, Nov 27 2019 *)
    Select[Range[80],SequenceCount[IntegerDigits[#,2],{x_,x_}]>0&] (* or *) Complement[Range[85],Table[FromDigits[PadRight[{},n,{1,0}],2],{n,7}]] (* Harvey P. Dale, Jul 31 2021 *)
  • Python
    def A107907(n): return (m:=n-2+(k:=(3*n+3).bit_length()))+(m>=(1<Chai Wah Wu, Apr 21 2025

Formula

a(A000247(n)) = A000225(n+2).
a(A000295(n+2)) = A000079(n+2).
a(A000325(n+2)) = A000051(n+2) for n>0.
a(n) = m+1 if m >= floor(2^k/3) otherwise a(n) = m where k = floor(log_2(3*(n+1))) and m = n-2+k. - Chai Wah Wu, Apr 21 2025

Extensions

Offset changed to 1 by Chai Wah Wu, Apr 21 2025

A023705 Numbers with no 0's in base-4 expansion.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 21, 22, 23, 25, 26, 27, 29, 30, 31, 37, 38, 39, 41, 42, 43, 45, 46, 47, 53, 54, 55, 57, 58, 59, 61, 62, 63, 85, 86, 87, 89, 90, 91, 93, 94, 95, 101, 102, 103, 105, 106, 107, 109, 110, 111, 117, 118, 119, 121, 122, 123
Offset: 1

Views

Author

Keywords

Comments

A032925 is the intersection of this sequence and A023717; cf. A179888. - Reinhard Zumkeller, Jul 31 2010

Crossrefs

Zeroless numbers in some other bases <= 10: A000042 (base 2), A032924 (base 3), A248910 (base 6), A255805 (base 8), A255808 (base 9), A052382 (base 10).
Cf. A100968 (subsequence).

Programs

  • C
    #include 
    uint32_t a_next(uint32_t a_n) { return (a_n + 1) | ((a_n & (a_n + 0xaaaaaaab)) >> 1); } /* Falk Hüffner, Jan 22 2022 */
    
  • Haskell
    a023705 n = a023705_list !! (n-1)
    a023705_list = iterate f 1 where
       f x = 1 + if r < 3 then x else 4 * f x'
             where (x', r) = divMod x 4
    -- Reinhard Zumkeller, Mar 06 2015, Oct 19 2011
    
  • Magma
    [n: n in [1..130] | not 0 in Intseq(n,4)]; // Vincenzo Librandi, Oct 04 2018
    
  • Maple
    R:= [1,2,3]: A:= 1,2,3:
    for i from 1 to 4 do
      R:= map(t -> (4*t+1,4*t+2,4*t+3), R);
      A:= A, op(R);
    od:
    A; # Robert Israel, Oct 04 2018
  • Mathematica
    Select[ Range[ 120 ], (Count[ IntegerDigits[ #, 4 ], 0 ]==0)& ]
    Select[Range[200],DigitCount[#,4,0]==0&] (* Harvey P. Dale, Dec 23 2015 *)
  • PARI
    isok(n) = vecmin(digits(n, 4)); \\ Michel Marcus, Jul 04 2015
    
  • Python
    from sympy import integer_log
    def A023705(n):
        m = integer_log(k:=(n<<1)+1,3)[0]
        return sum(1+(k-3**m)//(3**j<<1)%3<<(j<<1) for j in range(m)) # Chai Wah Wu, Jun 27 2025

Formula

G.f. g(x) satisfies g(x) = (x+2*x^2+3*x^3)/(1-x^3) + 4*(x+x^2+x^3)*g(x^3). - Robert Israel, Oct 04 2018

A003796 Numbers with no 3 adjacent 0's in binary expansion.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 89, 90, 91, 92
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A004779.
Cf. A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004742 (no 101), A004743 (no 110), A003726 (no 111).

Programs

  • Haskell
    a003796 n = a003796_list !! (n-1)
    a003796_list = filter f [0..] where
       f x  = x < 4 || x `mod` 8 /= 0 && f (x `div` 2)
    -- Reinhard Zumkeller, Jul 01 2013
    
  • Mathematica
    Select[Range[0,100],SequenceCount[IntegerDigits[#,2],{0,0,0}]==0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, Sep 12 2015 *)
  • PARI
    is(n)=while(n>7,if(bitand(n,7)==0,return(0));n>>=1); 1 \\ Charles R Greathouse IV, Feb 11 2017

Formula

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

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
Previous Showing 11-20 of 59 results. Next