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

A304101 Restricted growth sequence transform of A278222(A048679(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2018

Keywords

Comments

Positions of 2's is given by the positive Fibonacci numbers: 1, 2, 3, 5, 8, 13, 21, ..., that is, A000045(n) from n >= 2 onward.
Positions of 3's is given by Lucas numbers larger than 3: 4, 7, 11, 18, ..., that is, A000032(n) from n >= 3 onward.
Sequence allots a distinct value for each distinct multiset formed from the lengths of 1-runs in the binary representation of A048679(n). Compare to the scatter plot of A286622.

Crossrefs

Cf. also A286622 (compare the scatter-plots).

Programs

  • PARI
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A072649(n) = { my(m); if(n<1, 0, m=0; until(fibonacci(m)>n, m++); m-2); }; \\ From A072649
    A003714(n) = { my(s=0,w); while(n>2, w = A072649(n); s += 2^(w-1); n -= fibonacci(w+1)); (s+n); }
    A106151(n) = if(n<=1, n, if(n%2, 1+(2*A106151((n-1)/2)), A106151(n>>valuation(n, 2))<<(valuation(n, 2)-1)));
    A048679(n) = if(!n,n,A106151(2*A003714(n)));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    v304101 = rgs_transform(vector(1+up_to, n, A278222(A048679(n-1))));
    A304101(n) = v304101[1+n];

A072647 a(n) = A072637(A048679(n)).

Original entry on oeis.org

0, 1, 2, 6, 3, 15, 4, 5, 52, 7, 16, 19, 14, 466, 11, 9, 37, 8, 112, 42, 43, 5095, 20, 53, 44, 39, 127, 10, 28, 481, 123, 121, 149, 51, 17231, 29, 12, 40, 17, 41, 154, 155, 153, 18, 47, 156, 38, 1512, 477, 475, 385, 151, 1234, 122, 376, 69829, 55, 159, 56, 113, 164
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Comments

Composition of the permutations A072637 & A048679.

Crossrefs

A072645 gives the size of the corresponding parenthesizations, i.e., A072645(n) = A029837(A014486(A072647(n)) + 1)/2. (A029837(n+1) gives the binary width of n.)

A304100 a(n) = A003602(A048679(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 1, 5, 3, 2, 4, 1, 9, 5, 3, 6, 2, 7, 4, 1, 17, 9, 5, 10, 3, 11, 6, 2, 13, 7, 4, 8, 1, 33, 17, 9, 18, 5, 19, 10, 3, 21, 11, 6, 12, 2, 25, 13, 7, 14, 4, 15, 8, 1, 65, 33, 17, 34, 9, 35, 18, 5, 37, 19, 10, 20, 3, 41, 21, 11, 22, 6, 23, 12, 2, 49, 25, 13, 26, 7, 27, 14, 4, 29, 15, 8, 16, 1, 129, 65, 33, 66, 17, 67, 34, 9, 69, 35, 18, 36, 5, 73
Offset: 1

Views

Author

Antti Karttunen, May 13 2018

Keywords

Comments

Positions of ones is given by the positive Fibonacci numbers: 1, 2, 3, 5, 8, 13, 21, ..., that is, A000045(n) from n >= 2 onward.
Positions of 2's is given by Lucas numbers larger than 3: 4, 7, 11, 18, ..., that is, A000032(n) from n >= 3 onward.
The restricted growth sequence transform of this sequence (almost certainly) is A003603.

Crossrefs

Programs

Formula

a(n) = A003602(A048679(n)).
For all i, j: a(i) = a(j) => A304101(i) = A304101(j).

A072661 Composition of the A059905 and A048679, i.e., a(n) = A059905(A048679(n)).

Original entry on oeis.org

0, 1, 0, 2, 1, 0, 3, 2, 4, 1, 0, 2, 3, 0, 5, 4, 6, 1, 4, 3, 2, 8, 1, 0, 2, 5, 0, 7, 6, 4, 5, 4, 6, 3, 0, 9, 8, 10, 1, 8, 3, 2, 12, 1, 0, 2, 7, 8, 5, 4, 6, 5, 4, 7, 6, 16, 1, 0, 2, 9, 0, 11, 10, 4, 9, 8, 10, 3, 0, 13, 12, 14, 1, 12, 3, 2, 8, 9, 8, 10, 5, 8, 7, 6, 12, 5, 4, 6, 7, 0, 17, 16, 18, 1, 16, 3, 2
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

The other side of this projection is A072662. Used to construct the permutations A072657 and A072659.

A072662 Composition of the A059906 and A048679, i.e., a(n) = A059906(A048679(n)).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 1, 0, 2, 3, 2, 1, 4, 0, 1, 0, 3, 2, 2, 3, 0, 4, 5, 4, 1, 6, 0, 1, 4, 2, 3, 2, 3, 8, 0, 1, 0, 5, 2, 4, 5, 0, 6, 7, 6, 1, 4, 4, 5, 4, 3, 6, 2, 3, 0, 8, 9, 8, 1, 10, 0, 1, 8, 2, 3, 2, 5, 12, 0, 1, 0, 7, 2, 6, 7, 8, 4, 5, 4, 5, 6, 4, 5, 4, 6, 7, 6, 3, 16, 0, 1, 0, 9, 2, 8, 9, 0, 10, 11, 10, 1
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

The other side of this projection is A072661. Used to construct the permutations A072657 and A072659.

A374201 Lexicographically earliest infinite sequence such that a(i) = a(j) => A278222(A048679(A328845(i))) = A278222(A048679(A328845(j))), for all i, j >= 1, where A328845 is a Fibonacci-based variant of the arithmetic derivative.

Original entry on oeis.org

1, 1, 2, 2, 3, 2, 3, 2, 4, 4, 5, 2, 4, 2, 6, 7, 4, 2, 6, 2, 8, 9, 10, 2, 4, 7, 8, 6, 11, 2, 8, 2, 11, 8, 12, 7, 4, 2, 12, 13, 7, 2, 11, 2, 8, 8, 13, 2, 7, 10, 7, 8, 14, 2, 15, 7, 13, 12, 10, 2, 8, 2, 12, 7, 10, 13, 5, 2, 16, 17, 5, 2, 7, 2, 13, 7, 15, 16, 18, 2, 7, 18, 12, 2, 8, 19, 20, 13, 7, 2, 8, 18, 16, 12, 10, 21, 13, 2, 8, 9, 16
Offset: 0

Views

Author

Antti Karttunen, Jul 02 2024

Keywords

Comments

Restricted growth sequence transform of A278222(A048679(A328845(n))), or equally, of A304101(A328845(n)).
Related to the Zeckendorf-representation (A014417) of A328845(n).
For all i, j >= 0: a(i) = a(j) => A328847(i) = A328847(j).

Crossrefs

Programs

  • PARI
    up_to = 75025;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A072649(n) = { my(m); if(n<1, 0, m=0; until(fibonacci(m)>n, m++); m-2); }; \\ From A072649
    A003714(n) = { my(s=0,w); while(n>2, w = A072649(n); s += 2^(w-1); n -= fibonacci(w+1)); (s+n); }
    A106151(n) = { my(s=0, i=0); while(n, if(2!=(n%4), s += (n%2)<>= 1); (s); };
    A048679(n) = if(!n,n,A106151(2*A003714(n)));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };
    A278222(n) = A046523(A005940(1+n));
    A328845(n) = if(n<=1, 0, my(f=factor(n)); n*sum(i=1, #f~, f[i, 2]*fibonacci(f[i,1])/f[i, 1]));
    v374201 = rgs_transform(vector(1+up_to, n, A278222(A048679(A328845(n-1)))));
    A374201(n) = v374201[1+n];

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

A232559 Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x are in S, and duplicates are deleted as they occur.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 7, 12, 10, 9, 16, 14, 13, 24, 11, 20, 18, 17, 32, 15, 28, 26, 25, 48, 22, 21, 40, 19, 36, 34, 33, 64, 30, 29, 56, 27, 52, 50, 49, 96, 23, 44, 42, 41, 80, 38, 37, 72, 35, 68, 66, 65, 128, 31, 60, 58, 57, 112, 54, 53, 104, 51, 100, 98, 97
Offset: 1

Views

Author

Clark Kimberling, Nov 26 2013

Keywords

Comments

Let S be the set of numbers defined by these rules: 1 is in S, and if x is in S, then x + 1 and 2*x are in S. Then S is the set of all positive integers, which arise in generations. Deleting duplicates as they occur, the generations are given by g(1) = (1), g(2) = (2), g(3) = (3,4), g(4) = (6,5,8), g(5) = (7,12,10,9,16), etc. Concatenating these gives A232559, a permutation of the positive integers. The number of numbers in g(n) is A000045(n), the n-th Fibonacci number. It is helpful to show the results as a tree with the terms of S as nodes and edges from x to x + 1 if x + 1 has not already occurred, and an edge from x to 2*x if 2*x has not already occurred. The positions of the odd numbers are given by A026352, and of the evens, by A026351.
The previously mentioned tree is an example of a fractal tree; that is, an infinite rooted tree T such that every complete subtree of T contains a subtree isomorphic to T. - Clark Kimberling, Jun 11 2016
The similar sequence S', generated by these rules: 0 is in S', and if x is in S', then 2*x and x+1 are in S', and duplicates are deleted as they occur, appears to equal A048679. - Rémy Sigrist, Aug 05 2017
From Katherine E. Stange and Glen Whitney, Oct 09 2021: (Start)
The beginning of this tree is
1
|
2
/ \
3..../ \......4
| / \
6 5.../ \...8
/ \ | / \
7/ \12 10 9/ \16
This tree contains every positive integer, and one can show that the path from 1 to the integer n is exactly the sequence of intermediate values observed during the Double-And-Add Algorithm AKA Chandra Sutra Method (namely, the algorithm which begins with m = 0, reads the binary representation of n from left to right, and, for each digit 0 read, doubles m, and for each digit 1 read, doubles m and then adds 1 to m; when the algorithm terminates, m = n).
As such, the path between 1 and n is a function of the binary expansion of n. The elements of the k-th row of the tree (generation g(k)) are all those elements whose binary expansion has k_1 digits and Hamming weight k_2, for some k_1 and k_2 such that k_1 + k_2 = k + 1.
The depth at which integer n appears in this tree is given by A014701(n) = A056792(n)-1. For example, the depth of 1 is 0, the depth of 2 is 1, and the depths of 3 and 4 are both 2. (End)
Definition need not invoke deletion: Tree is rooted at 1, all even nodes have x+1 as a child, all nodes have 2*x as a child, and any x+1 child precedes its sibling. - Robert Munafo, May 08 2024

Examples

			Each x begets x + 1 and 2*x, but if either has already occurred it is deleted.  Thus, 1 begets 2, which begets (3,4); from which 3 begets only 6, and 4 begets (5,8).
		

Crossrefs

Cf. A232560 (inverse permutation), A232561, A232563, A226080, A226130.
Cf. A243571 (rows sorted).

Programs

  • Maple
    a:= proc() local l, s; l, s:= [1], {1}:
          proc(n) option remember; local i, r; r:= l[1];
            l:= subsop(1=NULL, l);
            for i in [1+r, r+r] do if not i in s then
              l, s:=[l[], i], s union {i} fi
            od; r
          end
        end():
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 06 2017
  • Mathematica
    z = 12; g[1] = {1}; g[2] = {2}; g[n_] := Riffle[g[n - 1] + 1, 2 g[n - 1]]; j[2] = Join[g[1], g[2]]; j[n_] := Join[j[n - 1], g[n]]; g1[n_] := DeleteDuplicates[DeleteCases[g[n], Alternatives @@ j[n - 1]]]; g1[1] = g[1]; g1[2] = g[2]; t = Flatten[Table[g1[n], {n, 1, z}]]  (* this sequence *)
    Table[Length[g1[n]], {n, 1, z}] (* Fibonacci numbers *)
    t1 = Flatten[Table[Position[t, n], {n, 1, 200}]]  (* A232560 *)
  • Python
    def aupton(terms):
        alst, S, expand = [1, 2], {1, 2}, [2]
        while len(alst) < terms:
            x = expand.pop(0)
            new_elts = [y for y in [x+1, 2*x] if y not in S]
            alst.extend(new_elts); expand.extend(new_elts); S.update(new_elts)
        return alst[:terms]
    print(aupton(66)) # Michael S. Branicky, Sep 14 2021

Formula

Conjecture: a(n) = A059894(A348366(n)) for n > 0. - Mikhail Kurkov, Jun 14 2022

A087808 a(0) = 0; a(2n) = 2a(n), a(2n+1) = a(n) + 1.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 4, 3, 8, 5, 6, 4, 8, 5, 6, 4, 16, 9, 10, 6, 12, 7, 8, 5, 16, 9, 10, 6, 12, 7, 8, 5, 32, 17, 18, 10, 20, 11, 12, 7, 24, 13, 14, 8, 16, 9, 10, 6, 32, 17, 18, 10, 20, 11, 12, 7, 24, 13, 14, 8, 16, 9, 10, 6, 64, 33, 34, 18, 36, 19, 20, 11, 40, 21, 22, 12
Offset: 0

Views

Author

Ralf Stephan, Oct 14 2003

Keywords

Crossrefs

This is Guy Steele's sequence GS(5, 4) (see A135416); compare GS(4, 5): A135529.
A048678(k) is where k appears first in the sequence.
A left inverse of A277020.
Cf. also A277006.

Programs

  • Haskell
    import Data.List (transpose)
    a087808 n = a087808_list !! n
    a087808_list = 0 : concat
       (transpose [map (+ 1) a087808_list, map (* 2) $ tail a087808_list])
    -- Reinhard Zumkeller, Mar 18 2015
    
  • Maple
    S := 2; f := proc(n) global S; option remember; if n=0 then RETURN(0); fi; if n mod 2 = 0 then RETURN(S*f(n/2)); else f((n-1)/2)+1; fi; end;
  • Mathematica
    a[0]=0; a[n_] := a[n] = If[EvenQ[n], 2*a[n/2], a[(n-1)/2]+1]; Array[a,76,0] (* Jean-François Alcover, Aug 12 2017 *)
  • PARI
    a(n)=if(n<1,0,if(n%2==0,2*a(n/2),a((n-1)/2)+1))
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A087808(n): return 0 if n == 0 else A087808(n//2) + (1 if n % 2 else A087808(n//2)) # Chai Wah Wu, Mar 08 2022
  • Scheme
    (define (A087808 n) (cond ((zero? n) n) ((even? n) (* 2 (A087808 (/ n 2)))) (else (+ 1 (A087808 (/ (- n 1) 2)))))) ;; Antti Karttunen, Oct 07 2016
    

Formula

a(n) = A135533(n)+1-2^(A000523(n)+1-A000120(n)). - Don Knuth, Mar 01 2008
From Antti Karttunen, Oct 07 2016: (Start)
a(n) = A048675(A005940(n+1)).
For all n >= 0, a(A003714(n)) = A048679(n).
For all n >= 0, a(A277020(n)) = n.
(End)

A005203 Fibonacci numbers (or rabbit sequence) converted to decimal.

Original entry on oeis.org

0, 1, 2, 5, 22, 181, 5814, 1488565, 12194330294, 25573364166211253, 439347050970302571643057846, 15829145720289447797800874537321282579904181, 9797766637414564027586288536574448245991597197836000123235901011048118
Offset: 0

Views

Author

Keywords

Comments

a(n) is also the denominator of the continued fraction [2^F(0), 2^F(1), 2^F(2), 2^F(3), 2^F(4), ..., 2^F(n-1)] for n>0. For the numerator, see A063896. - Chinmay Dandekar and Greg Dresden, Sep 11 2020

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    rewrite_0to1_1to10_n_i_times := proc(n,i) local z,j; z := n; j := i; while(j > 0) do z := rewrite_0to1_1to10(z); j := j - 1; od; RETURN(z); end;
    rewrite_0to1_1to10 := proc(n) option remember; if(n < 2) then RETURN(n + 1); else RETURN(((2^(1+(n mod 2))) * rewrite_0to1_1to10(floor(n/2))) + (n mod 2) + 1); fi; end;
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = a[n-1]*2^Fibonacci[n-1] + a[n-2]; Table[a[n], {n, 0, 12}] (* Jean-François Alcover, Jul 27 2011 *)
  • Python
    def A005203(n):
        s = '0'
        for i in range(n):
            s = s.replace('0','a').replace('1','10').replace('a','1')
        return int(s,2) # Chai Wah Wu, Apr 24 2025

Formula

a(0) = 0, a(1) = 1, a(n) = a(n-1) * 2^F(n-1) + a(n-2).
a(n) = rewrite_0to1_1to10_n_i_times(0, n) [ Each 0->1, 1->10 in binary expansion ]

Extensions

Comments and more terms from Antti Karttunen, Mar 30 1999
Showing 1-10 of 27 results. Next