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

A072646 Composition of the permutations A048680 & A072636, i.e., a(n) = A048680(A072636(n)).

Original entry on oeis.org

0, 1, 2, 4, 6, 7, 3, 9, 17, 15, 27, 14, 36, 62, 12, 5, 10, 38, 43, 11, 22, 93, 161, 150, 159, 91, 993, 1624, 28, 35, 61, 384, 413, 69, 235, 2591, 4243, 16, 46, 25, 37, 39, 19, 20, 24, 242, 415, 44, 237, 1606, 2627, 33, 8, 23, 72, 56, 58, 98, 1004, 1080, 100, 111, 614
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

Inverse permutation A072647.

A072793 Simple tabular N X N -> N bijection: first interleave the bits as with A054238, then apply the bijection A048680.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 8, 12, 11, 17, 13, 14, 15, 19, 20, 22, 23, 16, 25, 18, 33, 24, 38, 26, 27, 28, 30, 31, 40, 41, 43, 44, 21, 46, 32, 51, 29, 67, 45, 72, 34, 35, 36, 53, 54, 48, 49, 74, 75, 56, 57, 37, 59, 39, 88, 50, 80, 52, 122, 58, 93, 60, 61, 62, 64, 65, 82, 83
Offset: 0

Views

Author

Antti Karttunen, Jun 12 2002

Keywords

Crossrefs

Inverse: A072794. Composition of A048680 & A054238. The X-projection: A072661, The Y-projection: A072662. Used in global arithmetic ranking scheme presented in A072656.

A048679 Compressed fibbinary numbers (A003714), with rewrite 0->0, 01->1 applied to their binary expansion.

Original entry on oeis.org

0, 1, 2, 4, 3, 8, 5, 6, 16, 9, 10, 12, 7, 32, 17, 18, 20, 11, 24, 13, 14, 64, 33, 34, 36, 19, 40, 21, 22, 48, 25, 26, 28, 15, 128, 65, 66, 68, 35, 72, 37, 38, 80, 41, 42, 44, 23, 96, 49, 50, 52, 27, 56, 29, 30, 256, 129, 130, 132, 67, 136, 69, 70, 144, 73, 74, 76, 39, 160, 81
Offset: 0

Views

Author

Keywords

Comments

Permutation of the nonnegative integers (A001477); inverse permutation of A048680 i.e. A048679[ A048680[ n ] ] = n for all n.

Crossrefs

Programs

  • Maple
    a(n) = rewrite_0to0_x1to1(fibbinary(j)) (where fibbinary(j) = A003714[ n ])
    rewrite_0to0_x1to1 := proc(n) option remember; if(0 = n) then RETURN(n); else RETURN((2 * rewrite_0to0_x1to1(floor(n/(2^(1+(n mod 2)))))) + (n mod 2)); fi; end;
    fastfib := n -> round((((sqrt(5)+1)/2)^n)/sqrt(5)); fibinv_appr := n -> floor(log[ (sqrt(5)+1)/2 ](sqrt(5)*n)); fibinv := n -> (fibinv_appr(n) + floor(n/fastfib(1+fibinv_appr(n)))); fibbinary := proc(n) option remember; if(n <= 2) then RETURN(n); else RETURN((2^(fibinv(n)-2))+fibbinary_seq(n-fastfib(fibinv(n)))); fi; end;
    # second Maple program:
    b:= proc(n) is(n=0) end:
    a:= proc(n) option remember; local h; h:= iquo(a(n-1), 2)+1;
          while b(h) do h:= h*2 od; b(h):=true; h
        end: a(0):=0:
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 22 2014
  • Mathematica
    b[n_] := n==0; a[n_] := a[n] = Module[{h}, h = Quotient[a[n-1], 2] + 1; While[b[h], h = h*2]; b[h] = True; h]; a[0]=0; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 27 2016, after Alois P. Heinz *)
  • PARI
    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); }
    A007814(n) = valuation(n,2);
    A000265(n) = (n/2^valuation(n, 2));
    A106151(n) = if(n<=1,n,if(n%2,1+(2*A106151((n-1)/2)),(2^(A007814(n)-1))*A106151(A000265(n))));
    A048679(n) = if(!n,n,A106151(2*A003714(n))); \\ Antti Karttunen, May 13 2018, after Reinhard Zumkeller's May 09 2005 formula.
    
  • Python
    from itertools import count, islice
    def A048679_gen(): # generator of terms
        return map(lambda n: int(bin(n)[2:].replace('01','1'),2),filter(lambda n:not (n<<1)&n,count(0)))
    A048679_list = list(islice(A048679_gen(),20)) # Chai Wah Wu, Mar 18 2024
    
  • Python
    def A048679(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
            else:
                s <<= 1
        return s # Chai Wah Wu, Apr 24 2025

Formula

a(n) = A106151(2*A003714(n)) for n > 0. - Reinhard Zumkeller, May 09 2005
a(n+1) = min{([a(n)/2]+1)*2^k} such that it is not yet in the sequence. - Gerard Orriols, Jun 07 2014
a(n) = A072650(A003714(n)) = A003188(A227351(n)). - Antti Karttunen, May 13 2018

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

A074049 Tree generated by the Wythoff sequences: a permutation of the positive integers.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 8, 13, 6, 10, 11, 18, 12, 20, 21, 34, 9, 15, 16, 26, 17, 28, 29, 47, 19, 31, 32, 52, 33, 54, 55, 89, 14, 23, 24, 39, 25, 41, 42, 68, 27, 44, 45, 73, 46, 75, 76, 123, 30, 49, 50, 81, 51, 83, 84, 136, 53, 86, 87, 141, 88, 143, 144, 233, 22, 36, 37
Offset: 1

Views

Author

Clark Kimberling, Aug 14 2002

Keywords

Comments

Write t=tau=(1+sqrt(5))/2 and let S be generated by these rules: 1 is in S and if x is in S, then f(x) := [t*x] and g(x) := [(t+1)*x] are in S. Then S is the set of positive integers and the present permutation of S is obtained by arranging S in rows according to the order in which they are generated by f and g, starting with x=1.
The formula indicates the manner in which these numbers arise as a tree: 1 stems to 2, which branches to (3,5), and thereafter, each number branches to a pair:
3->(4,7) and 5->(8,13), etc.
The numbers >1 in the lower Wythoff sequence A000201 occupy the first place in each pair, and the numbers >2 in the upper Wythoff sequence A001950 occupy the second place. The pairs, together with (1,2) are the Wythoff pairs, much studied as the solutions of the Wythoff game. The Wythoff pairs also occur, juxtaposed, in the Wythoff array, A035513.

Examples

			First levels of the tree:
...................1
...................2
...........3.................5
.......4.......7........8........13
.....6..10...11..18....12..20...21..34
		

Crossrefs

Equals A048680(n-1) + 1.

Programs

  • Mathematica
    a = {1, 2}; row = {a[[-1]]}; r = GoldenRatio; s = r/(r - 1); Do[a = Join[a, row = Flatten[{Floor[#*{r, s}]} & /@ row]], {n, 5}]; a (* Ivan Neretin, Nov 09 2015 *)

Formula

Array T(n, k) by rows: T(0, 0)=1; T(1, 0)=2;
T(n, 2j) = floor(tau*T(n-1, j));
T(n, 2j+1) = floor((tau+1)*T(n-1, j))
for j=0,1,...,2^(n-1)-1, n>=2.

Extensions

Extended by Clark Kimberling, Dec 23 2010

A048678 Binary expansion of nonnegative integers expanded to "Zeckendorffian format" with rewrite rules 0->0, 1->01.

Original entry on oeis.org

0, 1, 2, 5, 4, 9, 10, 21, 8, 17, 18, 37, 20, 41, 42, 85, 16, 33, 34, 69, 36, 73, 74, 149, 40, 81, 82, 165, 84, 169, 170, 341, 32, 65, 66, 133, 68, 137, 138, 277, 72, 145, 146, 293, 148, 297, 298, 597, 80, 161, 162, 325, 164, 329, 330, 661, 168, 337, 338, 677, 340
Offset: 0

Views

Author

Keywords

Comments

No two adjacent 1-bits. Permutation of A003714.
Replace 1 with 01 in binary. - Ralf Stephan, Oct 07 2003

Examples

			11=1011 in binary, thus is rewritten as 100101 = 37 in decimal.
		

Crossrefs

MASKTRANS transform of A053644.
Cf. A124108.

Programs

  • Haskell
    a048678 0 = 0
    a048678 x = 2 * (b + 1) * a048678 x' + b
                where (x', b) = divMod x 2
    -- Reinhard Zumkeller, Mar 31 2015
    
  • Maple
    rewrite_0to0_1to01 := proc(n) option remember; if(n < 2) then RETURN(n); else RETURN(((2^(1+(n mod 2))) * rewrite_0to0_1to01(floor(n/2))) + (n mod 2)); fi; end;
  • Mathematica
    f[n_] := FromDigits[ Flatten[IntegerDigits[n, 2] /. {1 -> {0, 1}}], 2]; Table[f@n, {n, 0, 60}] (* Robert G. Wilson v, Dec 11 2009 *)
  • PARI
    a(n)=if(n<1,0,(3-(-1)^n)*a(floor(n/2))+(1-(-1)^n)/2)
    
  • PARI
    a(n) = if(n == 0, 0, my(A = -2); sum(i = 0, logint(n, 2), A++; if(bittest(n, i), 1 << (A++)))) \\ Mikhail Kurkov, Mar 14 2024
    
  • Python
    def a(n):
        return 0 if n==0 else (3 - (-1)**n)*a(n//2) + (1 - (-1)**n)//2
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 30 2017
    
  • Python
    def A048678(n): return int(bin(n)[2:].replace('1','01'),2) # Chai Wah Wu, Mar 18 2024

Formula

a(n) = rewrite_0to0_1to01(n) [ Each 0->1, 1->10 in binary expansion of n ].
a(0)=0; a(n) = (3-(-1)^n)*a(floor(n/2))+(1-(-1)^n)/2. - Benoit Cloitre, Aug 31 2003
a(0)=0, a(2n) = 2a(n), a(2n+1) = 4a(n) + 1. - Ralf Stephan, Oct 07 2003

A179245 Numbers that have 5 terms in their Zeckendorf representation.

Original entry on oeis.org

88, 122, 135, 140, 142, 143, 177, 190, 195, 197, 198, 211, 216, 218, 219, 224, 226, 227, 229, 230, 231, 266, 279, 284, 286, 287, 300, 305, 307, 308, 313, 315, 316, 318, 319, 320, 334, 339, 341, 342, 347, 349, 350, 352, 353, 354, 360, 362, 363, 365, 366, 367
Offset: 1

Views

Author

Emeric Deutsch, Jul 05 2010

Keywords

Comments

A007895(a(n)) = 5. - Reinhard Zumkeller, Mar 10 2013
Numbers that are the sum of five non-consecutive Fibonacci numbers. Their Zeckendorf representation thus consists of five 1's with at least one 0 between each pair of 1's; for example, 122 is represented as 1001010101. - Alonso del Arte, Nov 17 2013

Examples

			88  = 55 + 21 + 8 + 3 + 1.
122 = 89 + 21 + 8 + 3 + 1.
135 = 89 + 34 + 8 + 3 + 1.
140 = 89 + 34 + 13 + 3 + 1.
142 = 89 + 34 + 13 + 5 + 1.
81 is not in the sequence because, although it is the sum of five Fibonacci numbers (81 = 5 + 8 + 13 + 21 + 34), its Zeckendorf representation only has three terms: 81 = 55 + 21 + 5.
		

Crossrefs

Cf. A035517, A007895. Numbers that have m terms in their Zeckendorf representations: A179242 (m = 2), A179243 (m = 3), A179244 (m = 4), A179246 (m = 6), A179247 (m = 7), A179248 (m = 8), A179249 (m = 9), A179250 (m = 10), A179251 (m = 11), A179252 (m = 12), A179253 (m = 13).

Programs

  • Haskell
    a179245 n = a179245_list !! (n-1)
    a179245_list = filter ((== 5) . a007895) [1..]
    -- Reinhard Zumkeller, Mar 10 2013
    
  • Maple
    with(combinat): B := proc (n) local A, ct, m, j: A := proc (n) local i: for i while fibonacci(i) <= n do n-fibonacci(i) end do end proc: ct := 0: m := n: for j while 0 < A(m) do ct := ct+1: m := A(m) end do: ct+1 end proc: Q := {}: for i from fibonacci(11)-1 to 400 do if B(i) = 5 then Q := `union`(Q, {i}) else end if end do: Q;
  • Mathematica
    zeck = DigitCount[Select[Range[3000], BitAnd[#, 2*#] == 0 &], 2, 1];
    Position[zeck, 5] // Flatten (* Jean-François Alcover, Jan 30 2018 *)
  • PARI
    A048680(n)=my(k=1,s);while(n,if(n%2,s+=fibonacci(k++)); k++; n>>=1); s
    [A048680(n)|n<-[1..100],hammingweight(n)==5] \\ Charles R Greathouse IV, Nov 17 2013

Formula

a(n) = A048680(A014313(n)). - Charles R Greathouse IV, Nov 17 2013

A072656 Permutation of natural numbers induced by reranking plane binary trees given in the standard lexicographic order (A014486) with an "arithmetic global ranking algorithm", using packA048680oA054238 as the packing bijection N X N -> N.

Original entry on oeis.org

0, 1, 3, 2, 11, 6, 5, 7, 4, 100, 27, 24, 45, 14, 18, 10, 13, 62, 17, 8, 15, 28, 9, 1988, 477, 179, 1100, 116, 150, 61, 113, 2090, 147, 35, 189, 302, 58, 162, 44, 39, 73, 23, 34, 20, 102, 1229, 295, 29, 111, 680, 72, 21, 12, 26, 93, 38, 47, 70, 1292, 91, 16, 22, 117, 187
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

A072658 Permutation of natural numbers induced by reranking plane binary trees given in the standard lexicographic order (A014486) with an "arithmetic global ranking algorithm", using packA048680oA054238tr as the packing bijection N X N -> N.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 5, 6, 11, 9, 28, 15, 17, 62, 8, 13, 10, 14, 45, 18, 24, 27, 100, 36, 187, 117, 91, 1292, 22, 70, 38, 72, 680, 93, 111, 295, 1229, 16, 47, 26, 29, 102, 12, 20, 23, 58, 302, 73, 189, 147, 2090, 21, 34, 39, 35, 113, 44, 61, 116, 1100, 162, 150, 179, 477
Offset: 0

Views

Author

Antti Karttunen, Jun 02 2002

Keywords

Crossrefs

A227352 Permutation of nonnegative integers: map each number by lengths of runs in its binary representation to the number in whose once left-shifted Zeckendorf representation occurs the same run lengths (in the same order) as the lengths of consecutive blocks of zeros.

Original entry on oeis.org

0, 1, 4, 2, 7, 12, 6, 3, 11, 19, 33, 20, 10, 17, 9, 5, 18, 30, 51, 31, 54, 88, 53, 32, 16, 27, 46, 28, 15, 25, 14, 8, 29, 48, 80, 49, 83, 135, 82, 50, 87, 142, 232, 143, 86, 140, 85, 52, 26, 43, 72, 44, 75, 122, 74, 45, 24, 40, 67, 41, 23, 38, 22, 13, 47, 77
Offset: 0

Views

Author

Antti Karttunen, Jul 08 2013

Keywords

Comments

See the comments at the inverse permutation A227351 where the idea behind this mapping is explained.

Crossrefs

Inverse permutation: A227351. Cf. A048680, A003188.

Programs

Formula

a(n) = A048680(A003188(n)). [The defining formula]
Moreover, this permutation effects the following correspondences:
For n>=1 A000523(n) = A102364(a(n)).
For all n, A167489(n) = A227355(a(2n+1)).
Showing 1-10 of 15 results. Next