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-5 of 5 results.

A003714 Fibbinary numbers: if n = F(i1) + F(i2) + ... + F(ik) is the Zeckendorf representation of n (i.e., write n in Fibonacci number system) then a(n) = 2^(i1 - 2) + 2^(i2 - 2) + ... + 2^(ik - 2). Also numbers whose binary representation contains no two adjacent 1's.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 16, 17, 18, 20, 21, 32, 33, 34, 36, 37, 40, 41, 42, 64, 65, 66, 68, 69, 72, 73, 74, 80, 81, 82, 84, 85, 128, 129, 130, 132, 133, 136, 137, 138, 144, 145, 146, 148, 149, 160, 161, 162, 164, 165, 168, 169, 170, 256, 257, 258, 260, 261, 264
Offset: 0

Views

Author

Keywords

Comments

The name "Fibbinary" is due to Marc LeBrun.
"... integers whose binary representation contains no consecutive ones and noticed that the number of such numbers with n bits was fibonacci(n)". [posting to sci.math by Bob Jenkins (bob_jenkins(AT)burtleburtle.net), Jul 17 2002]
From Benoit Cloitre, Mar 08 2003: (Start)
A number m is in the sequence if and only if C(3m, m) (or equally, C(3m, 2m)) is odd.
a(n) == A003849(n) (mod 2). (End)
Numbers m such that m XOR 2*m = 3*m. - Reinhard Zumkeller, May 03 2005. [This implies that A003188(2*a(n)) = 3*a(n) holds for all n.]
Numbers whose base-2 representation contains no two adjacent ones. For example, m = 17 = 10001_2 belongs to the sequence, but m = 19 = 10011_2 does not. - Ctibor O. Zizka, May 13 2008
m is in the sequence if and only if the central Stirling number of the second kind S(2*m, m) = A007820(m) is odd. - O-Yeat Chan (math(AT)oyeat.com), Sep 03 2009
A000120(3*a(n)) = 2*A000120(a(n)); A002450 is a subsequence.
Every nonnegative integer can be expressed as the sum of two terms of this sequence. - Franklin T. Adams-Watters, Jun 11 2011
Subsequence of A213526. - Arkadiusz Wesolowski, Jun 20 2012
This is also the union of A215024 and A215025 - see the Comment in A014417. - N. J. A. Sloane, Aug 10 2012
The binary representation of each term m contains no two adjacent 1's, so we have (m XOR 2m XOR 3m) = 0, and thus a two-player Nim game with three heaps of (m, 2m, 3m) stones is a losing configuration for the first player. - V. Raman, Sep 17 2012
Positions of zeros in A014081. - John Keith, Mar 07 2022
These numbers are similar to Fibternary numbers A003726, Tribbinary numbers A060140 and Tribternary numbers. This sequence is a subsequence of Fibternary numbers A003726. The number of Fibbinary numbers less than any power of two is a Fibonacci number. We can generate this sequence recursively: start with 0 and 1; then, if x is in the sequence add 2x and 4x+1 to the sequence. The Fibbinary numbers have the property that the n-th Fibbinary number is even if the n-th term of the Fibonacci word is a. Respectively, the n-th Fibbinary number is odd (of the form 4x+1) if the n-th term of the Fibonacci word is b. Every number has a Fibbinary multiple. - Tanya Khovanova and PRIMES STEP Senior, Aug 30 2022
This is the ordered set S of numbers defined recursively by: 0 is in S; if x is in S, then 2*x and 4*x + 1 are in S. See Kimberling (2006) Example 3, in references below. - Harry Richman, Jan 31 2024

Examples

			From _Joerg Arndt_, Jun 11 2011: (Start)
In the following, dots are used for zeros in the binary representation:
  a(n)  binary(a(n))  n
    0:    .......     0
    1:    ......1     1
    2:    .....1.     2
    4:    ....1..     3
    5:    ....1.1     4
    8:    ...1...     5
    9:    ...1..1     6
   10:    ...1.1.     7
   16:    ..1....     8
   17:    ..1...1     9
   18:    ..1..1.    10
   20:    ..1.1..    11
   21:    ..1.1.1    12
   32:    .1.....    13
   33:    .1....1    14
   34:    .1...1.    15
   36:    .1..1..    16
   37:    .1..1.1    17
   40:    .1.1...    18
   41:    .1.1..1    19
   42:    .1.1.1.    20
   64:    1......    21
   65:    1.....1    22
(End)
		

References

  • Donald E. Knuth, The Art of Computer Programming: Fundamental Algorithms, Vol. 1, 2nd ed., Addison-Wesley, 1973, pp. 85, 493.

Crossrefs

A007088(a(n)) = A014417(n) (same sequence in binary). Complement: A004780. Char. function: A085357. Even terms: A022340, odd terms: A022341. First difference: A129761.
Other sequences based on similar restrictions on binary expansion: A003726 & A278038, A003754, A048715, A048718, A107907, A107909.
3*a(n) is in A001969.
Cf. A014081 (count 11 bits).

Programs

  • Haskell
    import Data.Set (Set, singleton, insert, deleteFindMin)
    a003714 n = a003714_list !! n
    a003714_list = 0 : f (singleton 1) where
       f :: Set Integer -> [Integer]
       f s = m : (f $ insert (4*m + 1) $ insert (2*m) s')
             where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Jun 03 2012, Feb 07 2012
    
  • Maple
    A003714 := proc(n)
        option remember;
        if n < 3 then
            n ;
        else
            2^(A072649(n)-1) + procname(n-combinat[fibonacci](1+A072649(n))) ;
        end if;
    end proc:
    seq(A003714(n),n=0..10) ;
    # To produce a table giving n, a(n) (base 10), a(n) (base 2) - from N. J. A. Sloane, Sep 30 2018
    # binary: binary representation of n, in human order
    binary:=proc(n) local t1,L;
    if n<0 then ERROR("n must be nonnegative"); fi;
    if n=0 then return([0]); fi;
    t1:=convert(n,base,2); L:=nops(t1);
    [seq(t1[L+1-i],i=1..L)];
    end;
    for n from 0 to 100 do t1:=A003714(n); lprint(n, t1, binary(t1)); od:
  • Mathematica
    fibBin[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]]; Table[fibBin[n], {n, 0, 61}] (* Robert G. Wilson v, Sep 18 2004 *)
    Select[Range[0, 270], ! MemberQ[Partition[IntegerDigits[#, 2], 2, 1], {1, 1}] &] (* Harvey P. Dale, Jul 17 2011 *)
    Select[Range[256], BitAnd[#, 2 #] == 0 &] (* Alonso del Arte, Jun 18 2012 *)
    With[{r = Range[10^5]}, Pick[r, BitAnd[r, 2 r], 0]] (* Eric W. Weisstein, Aug 18 2017 *)
    Select[Range[0, 299], SequenceCount[IntegerDigits[#, 2], {1, 1}] == 0 &] (* Requires Mathematica version 10 or later. -- Harvey P. Dale, Dec 06 2018 *)
  • PARI
    msb(n)=my(k=1); while(k<=n, k<<=1); k>>1
    for(n=1,1e4,k=bitand(n,n<<1);if(k,n=bitor(n,msb(k)-1),print1(n", "))) \\ Charles R Greathouse IV, Jun 15 2011
    
  • PARI
    select( is_A003714(n)=!bitand(n,n>>1), [0..266])
    {(next_A003714(n,t)=while(t=bitand(n+=1,n<<1), n=bitor(n,1<A003714(t)) \\ M. F. Hasler, Nov 30 2021
    
  • Python
    for n in range(300):
        if 2*n & n == 0:
            print(n, end=",") # Alex Ratushnyak, Jun 21 2012
    
  • Python
    def A003714(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n:
            tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            s *= 2
            if d <= n:
                s += 1
                n -= d
        return s # Chai Wah Wu, Jun 14 2018
    
  • Python
    def fibbinary():
        x = 0
        while True:
            yield x
            y = ~(x >> 1)
            x = (x - y) & y # Falk Hüffner, Oct 23 2021
    (C++)
    /* start with x=0, then repeatedly call x=next_fibrep(x): */
    ulong next_fibrep(ulong x)
    {
        // 2 examples:         //  ex. 1             //  ex.2
        //                     // x == [*]0 010101   // x == [*]0 01010
        ulong y = x | (x>>1);  // y == [*]? 011111   // y == [*]? 01111
        ulong z = y + 1;       // z == [*]? 100000   // z == [*]? 10000
        z = z & -z;            // z == [0]0 100000   // z == [0]0 10000
        x ^= z;                // x == [*]0 110101   // x == [*]0 11010
        x &= ~(z-1);           // x == [*]0 100000   // x == [*]0 10000
        return x;
    }
    /* Joerg Arndt, Jun 22 2012 */
    
  • Scala
    (0 to 255).filter(n => (n & 2 * n) == 0) // Alonso del Arte, Apr 12 2020
    (C#)
    public static bool IsFibbinaryNum(this int n) => ((n & (n >> 1)) == 0) ? true : false; // Frank Hollstein, Jul 07 2021

Formula

No two adjacent 1's in binary expansion.
Let f(x) := Sum_{n >= 0} x^Fibbinary(n). (This is the generating function of the characteristic function of this sequence.) Then f satisfies the functional equation f(x) = x*f(x^4) + f(x^2).
a(0) = 0, a(1) = 1, a(2) = 2, a(n) = 2^(A072649(n) - 1) + a(n - A000045(1 + A072649(n))). - Antti Karttunen
It appears that this sequence gives m such that A082759(3*m) is odd; or, probably equivalently, m such that A037011(3*m) = 1. - Benoit Cloitre, Jun 20 2003
If m is in the sequence then so are 2*m and 4*m + 1. - Henry Bottomley, Jan 11 2005
A116361(a(n)) <= 1. - Reinhard Zumkeller, Feb 04 2006
A085357(a(n)) = 1; A179821(a(n)) = a(n). - Reinhard Zumkeller, Jul 31 2010
a(n)/n^k is bounded (but does not tend to a limit), where k = 1.44... = A104287. - Charles R Greathouse IV, Sep 19 2012
a(n) = a(A193564(n+1))*2^(A003849(n) + 1) + A003849(n) for n > 0. - Daniel Starodubtsev, Aug 05 2021
There are Fibonacci(n+1) terms with up to n bits in this sequence. - Charles R Greathouse IV, Oct 22 2021
Sum_{n>=1} 1/a(n) = 3.704711752910469457886531055976801955909489488376627037756627135425780134020... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022

Extensions

Edited by Antti Karttunen, Feb 21 2006
Cross reference to A007820 added (into O-Y.C. comment) by Jason Kimberley, Sep 14 2009
Typo corrected by Jeffrey Shallit, Sep 26 2014

A371176 Numbers k such that A000120(k) <= A001511(k).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 28, 32, 34, 36, 40, 44, 48, 52, 56, 64, 66, 68, 72, 76, 80, 84, 88, 96, 100, 104, 112, 120, 128, 130, 132, 136, 140, 144, 148, 152, 160, 164, 168, 176, 184, 192, 196, 200, 208, 216, 224, 232, 240, 256, 258, 260, 264, 268
Offset: 1

Views

Author

Mikhail Kurkov, Mar 14 2024

Keywords

Comments

It appears that this sequence is obtained when ordering Schreier sets as explained in the Bird link. See decM(n) PARI code. - Michel Marcus, May 31 2024
That is correct since the binary representation of these numbers can be put into 1-to-1 correspondence with Schreier sets, which satisfy |X| <= min X, using the indicator function of X as the bits (starting from the right, LSB). The reason is that A000120 then computes |X| and A001511 computes min X. For example, the Schreier set X = {2, 5} can be mapped to 10010_2 = 18. - Michael S. Branicky, May 31 2024
From David A. Corneth, May 31 2024: (Start)
If k is in the sequence then so is 2*k.
a(A000045(k)) = 2^(k-2) for k >= 2. (End)
Apart from a(1), all terms are even. - Paolo Xausa, May 31 2024
Zeckendorf representation of n with rewrite 0 -> 0, {0, 1} -> 1 and k-1 zeros appended to the right side (where k is the number of ones in the given representation) and then interpreted as binary expansion is the same as a(n) (see the first formula). - Mikhail Kurkov, Oct 21 2024

Crossrefs

Programs

  • Maple
    filter:= proc(n) convert(convert(n,base,2),`+`) <= 1+padic:-ordp(n,2) end proc:
    select(filter, [1,seq(i,i=2..1000,2)]); # Robert Israel, Oct 20 2024
  • Mathematica
    Join[{1}, Select[Range[2, 1000, 2], DigitSum[#, 2] <= IntegerExponent[#, 2] + 1 &]] (* Paolo Xausa, Aug 12 2025 *)
  • PARI
    isok(n) = hammingweight(n) <= (valuation(n, 2) + 1)
    
  • PARI
    M(n) = my(list=List()); for (i=1, n, forsubset(i, s, my(bOk = if (#s && (vecmax(s) == n), #s <= vecmin(s), 0)); if (bOk, listput(list, vecsort(Vec(s),,4))););); Vec(list);
    decM(nn) = my(v = vector(nn, k, M(k)), list=List()); for (i=1, #v, my(vi = v[i]); for (j=1, #vi, my(s = vecsort(vi[j]), slist=List(), m = vecmax(s)); forstep(k=m, 1, -1, listput(slist, sign(vecsearch(s, k)))); listput(list, fromdigits(Vec(slist), 2)););); vecsort(Vec(list)); \\ Michel Marcus, May 31 2024
    
  • Python
    def ok(n): return n.bit_count() <= (-n&n).bit_length()
    print([k for k in range(1, 300) if ok(k)]) # Michael S. Branicky, May 31 2024
    
  • Python
    # Assuming the list starts with 0.
    def a():
        n = na = nb = 1
        while True:
            yield not(nb < (na - 1) << 1)
            nb, na = na, n.bit_count()
            n += 1
    aList = a(); print([n for n in range(77) if next(aList)]) # Peter Luschny, Jun 07 2024

Formula

a(n) = b(n)*A001316(b(n))/2 where b(n) = A048679(n).
a(n) = Sum_{i=0..n-1} 2^A213911(i).
a(n) = 2^(A072649(n) - 1) + [c(n) > 0]*2*a(c(n)) where c(n) = A066628(n).
a(n) = 2*a(A005206(n)) - A003849(n)*2^A007895(n-1) for n > 1 with a(1) = 1.
Conjecture: lim sup_{n -> oo} log(a(n))/log(n) = log(2) / log((1 + sqrt(5))/2) = 1.440420090412556479... = A104287. - Vaclav Kotesovec, Aug 12 2025

A115845 Numbers n such that there is no bit position where the binary expansions of n and 8n are both 1.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 17, 20, 21, 24, 28, 32, 33, 34, 35, 40, 42, 48, 49, 56, 64, 65, 66, 67, 68, 69, 70, 71, 80, 81, 84, 85, 96, 97, 98, 99, 112, 113, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 140, 142, 160, 161, 162, 163, 168, 170, 192
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2006

Keywords

Comments

Equivalently, numbers n such that 9*n = 9 X n, i.e., 8*n XOR n = 9*n. Here * stands for ordinary multiplication and X means carryless (GF(2)[X]) multiplication (A048720).
Equivalently, numbers n such that the binomial coefficient C(9n,n) (A169958) is odd. - Zak Seidov, Aug 06 2010
The equivalence of these three definitions follows from Lucas's theorem on binomial coefficients. - N. J. A. Sloane, Sep 01 2010
Clearly all numbers k*2^i for 1 <= k <= 7 have this property. - N. J. A. Sloane, Sep 01 2010
A116361(a(n)) <= 3. - Reinhard Zumkeller, Feb 04 2006

Crossrefs

A115846 shows this sequence in binary.
A033052 is a subsequence.

Programs

  • Mathematica
    Reap[Do[If[OddQ[Binomial[9n,n]],Sow[n]],{n,0,400}]][[2,1]] (* Zak Seidov, Aug 06 2010 *)
  • PARI
    is(n)=!bitand(n,n<<3) \\ Charles R Greathouse IV, Sep 23 2012

Formula

a(n)/n^k is bounded (but does not tend to a limit), where k = 1.44... = A104287. - Charles R Greathouse IV, Sep 23 2012

Extensions

Edited with a new definition by N. J. A. Sloane, Sep 01 2010, merging this sequence with a sequence submitted by Zak Seidov, Aug 06 2010

A052005 Number of Fibonacci numbers (A000045) with length n in base 2.

Original entry on oeis.org

2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

There are no double 2's except at the very start because multiplying by phi^3 adds at least 2 to Fn's binary length. For a similar reason there aren't any 3's because multiplying by phi^2 increments at least by one F(n)'s binary length.
Also a(n) is the number of Fibonacci numbers F(k) between powers of 2 such that 2^n <= F(k) < 2^(n+1). - Frank M Jackson, Apr 14 2013

Examples

			F(17) = 1597{10} = 11000111101{2} the only one of length 11 and F(18) = 2584{10} = 101000011000{2} the only one of length 12 so both a(11) and a(12) equal 1.
		

Crossrefs

Programs

  • Mathematica
    nmax = 105; kmax = Floor[ k /. FindRoot[ Log[2, Fibonacci[k]] == nmax, {k, nmax, 2*nmax}]]; A052005 = Tally[ Length /@ IntegerDigits[ Fibonacci[ Range[kmax]], 2]][[All, 2]] (* Jean-François Alcover, May 07 2012 *)
    termcount[n1_] := (m1=0; While[Fibonacci[m1]<2^n1, m1++]; m1); Table[termcount[n+1]-termcount[n], {n, 0, 200}] (* Frank M Jackson, Apr 14 2013 *)
    Most[Transpose[Tally[Table[Length[IntegerDigits[Fibonacci[n], 2]], {n, 140}]]][[2]]] (* T. D. Noe, Apr 16 2013 *)

Formula

Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = log(2)/log(phi) = A104287. - Amiram Eldar, Nov 21 2021

A174611 Decimal expansion of log(2)/log(phi) - 1 where phi=(1+sqrt(5))/2.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Mar 23 2010

Keywords

Examples

			0.440420090412556479017551499587863802458604142684...
		

Crossrefs

Cf. A104287.

Programs

  • Mathematica
    RealDigits[Log[2]/Log[GoldenRatio] - 1, 10, 120][[1]]  (* Harvey P. Dale, Apr 04 2011 *)

Formula

Equals A104287-1.
Showing 1-5 of 5 results.