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

A277196 Permutation of natural numbers: a(n) = A107079(A277006(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 11, 8, 10, 14, 23, 19, 9, 15, 21, 34, 28, 48, 44, 65, 12, 17, 26, 40, 41, 57, 69, 101, 89, 94, 144, 233, 129, 13, 22, 32, 53, 49, 75, 80, 120, 115, 111, 168, 279, 203, 137, 176, 261, 438, 283, 609, 470, 703, 16, 25, 35, 60, 63, 82, 104, 157, 128, 148, 217, 363, 236, 152, 227, 342, 569, 334, 798, 554, 833, 199, 270
Offset: 0

Views

Author

Antti Karttunen, Oct 07 2016

Keywords

Comments

Note the indexing: domain starts from 0, but the range starts from 1.

Crossrefs

Programs

Formula

a(n) = A107079(A277006(n)) = A107079(A005940(1+A003714(n))).
Other identities:
For all n >= 1, a(A000045(n+1)) = A071403(n).

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

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)

A277010 a(n) = A156552(A005117(n)); permutation of Fibbinary numbers.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 16, 32, 17, 10, 64, 128, 18, 33, 256, 65, 512, 21, 1024, 34, 129, 20, 2048, 257, 66, 4096, 37, 8192, 513, 16384, 130, 32768, 36, 258, 1025, 65536, 131072, 2049, 68, 69, 262144, 514, 41, 524288, 1048576, 4097, 40, 133, 2097152, 8193, 4194304, 132, 16385, 1026, 8388608, 72, 2050, 32769, 260, 16777216, 33554432, 261, 67108864, 42
Offset: 1

Views

Author

Antti Karttunen, Oct 07 2016

Keywords

Comments

Permutation of A003714 (Fibbinary numbers).

Crossrefs

Programs

  • Python
    from math import isqrt
    from sympy import mobius, primepi, factorint
    def A277010(n):
        def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        return sum(1<Chai Wah Wu, Aug 31 2024
  • Scheme
    (define (A277010 n) (A156552 (A005117 n)))
    

Formula

a(n) = A156552(A005117(n)).
Other identities. For all n >= 1:
a(A071403(n)) = A000079(n-1).

A280873 Numbers whose binary expansion does not begin 10 and does not contain 2 adjacent 0's; Ahnentafel numbers of X-chromosome inheritance of a male.

Original entry on oeis.org

0, 1, 3, 6, 7, 13, 14, 15, 26, 27, 29, 30, 31, 53, 54, 55, 58, 59, 61, 62, 63, 106, 107, 109, 110, 111, 117, 118, 119, 122, 123, 125, 126, 127, 213, 214, 215, 218, 219, 221, 222, 223, 234, 235, 237, 238, 239, 245, 246, 247, 250, 251, 253, 254, 255
Offset: 0

Views

Author

Floris Strijbos, Jan 09 2017

Keywords

Comments

The number of ancestors at generation m from whom a living individual may have received an X chromosome allele is F_m, the m-th term of the Fibonacci Sequence.
From Antti Karttunen, Oct 11 2017: (Start)
The starting offset is zero (with a(0) = 0) for the same reason that we have A003714(0) = 0. Indeed, b(n) = A054429(A003714(n)) for n >= 0 yields the terms of this sequence, but in different order.
A163511(a(n)) for n >= 0 gives a permutation of squarefree numbers (A005117). See also A277006.
(End)

Crossrefs

Intersection of A003754 and A004760.
Positions where A163511 obtains squarefree (A005117) values.
Cf. also A293437 (a subsequence).

Programs

  • Maple
    gen[0]:= {0,1,3}:
    gen[1]:= {6,7}:
    for n from 2 to 10 do
      gen[n]:= map(t -> 2*t+1, gen[n-1]) union
          map(t -> 2*t, select(type, gen[n-1],odd))
    od:
    sort(convert(`union`(seq(gen[i],i=0..10)),list)); # Robert Israel, Oct 11 2017
  • Mathematica
    male = {1, 3}; generations = 8;
    Do[x = male[[i - 1]]; If[EvenQ[x],
                              male = Append[ male,   2*x + 1] ,
                              male = Flatten[Append[male, {2*x, 2*x + 1}]]]
           , {i, 3, Fibonacci[generations + 1]}]; male
  • PARI
    isA003754(n) = { n=bitor(n, n>>1)+1; n>>=valuation(n, 2); (n==1); }; \\ After Charles R Greathouse IV's Feb 06 2017 code.
    isA004760(n) = (n<2 || (binary(n)[2])); \\ This function also from Charles R Greathouse IV, Sep 23 2012
    isA280873(n) = (isA003754(n) && isA004760(n));
    n=0; k=0; while(k <= 10946, if(isA280873(n),write("b280873.txt", k, " ", n);k=k+1); n=n+1;); \\ Antti Karttunen, Oct 11 2017
    
  • Python
    def A280873():
        yield 1
        for x in A280873():
            if ((x & 1) and (x > 1)):
                yield 2*x
            yield 2*x+1
    def take(n, g):
      '''Returns a list composed of the next n elements returned by generator g.'''
      z = []
      if 0 == n: return(z)
      for x in g:
        z.append(x)
        if n > 1: n = n-1
        else: return(z)
    take(120, A280873())
    # Antti Karttunen, Oct 11 2017, after the given Mathematica-code (by Floris Strijbos) and a similar generator-example for A003714 by David Eppstein (cf. "Self-recursive generators" link).

Formula

{a(n) : n >= 1} = {k >= 1 : A365538(A054429(k)) > 0}. - Peter Munn, Jan 22 2024

Extensions

a(0) = 0 prepended and more descriptive alternative name added by Antti Karttunen, Oct 11 2017

A277332 a(n) = A253565(A003714(n)).

Original entry on oeis.org

1, 2, 3, 5, 9, 7, 25, 15, 11, 49, 35, 21, 75, 13, 121, 77, 55, 245, 33, 147, 105, 17, 169, 143, 91, 847, 65, 605, 385, 39, 363, 231, 165, 735, 19, 289, 221, 187, 1859, 119, 1183, 1001, 85, 845, 715, 455, 4235, 51, 507, 429, 273, 2541, 195, 1815, 1155, 23, 361, 323, 247, 3757, 209, 3179, 2431, 133, 2023, 1547, 1309, 13013, 95
Offset: 0

Views

Author

Antti Karttunen, Oct 12 2016

Keywords

Comments

After the initial terms 1, 2 and 3, all other terms can be inductively generated by applying any finite composition-combination of A253560 and A253550 to 3, but with such a restriction that A253560 may not be applied twice in succession.
A permutation of A277334.
Note how A253565(A022340(n)) = A253565(2*A003714(n)) yields a permutation of A056911, odd squarefree numbers.

Examples

			55 = A253550(A253550(A253560(A253550(3)))), 55 is in this sequence.
		

Crossrefs

Cf. A277334 (same sequence sorted into ascending order).
Cf. also A056911, A277006, A277331.

Programs

Formula

a(n) = A253565(A003714(n)).

A277331 a(n) = A253563(A003714(n)).

Original entry on oeis.org

1, 2, 4, 8, 6, 16, 12, 18, 32, 24, 36, 54, 30, 64, 48, 72, 108, 60, 162, 90, 150, 128, 96, 144, 216, 120, 324, 180, 300, 486, 270, 450, 750, 210, 256, 192, 288, 432, 240, 648, 360, 600, 972, 540, 900, 1500, 420, 1458, 810, 1350, 2250, 630, 3750, 1050, 1470, 512, 384, 576, 864, 480, 1296, 720, 1200, 1944, 1080, 1800, 3000, 840
Offset: 0

Views

Author

Antti Karttunen, Oct 12 2016

Keywords

Comments

After the initial terms 1, 2 and 4, all other terms can be inductively generated by applying any finite composition-combination of A253560 and A253550 to 4, but with such a restriction that A253550 may not be applied twice in succession.
A permutation of A055932.

Crossrefs

Cf. A003714, A055932 (same sequence sorted into ascending order), A253550, A253560, A253563, A122111.
Cf. also A277006, A277332.

Programs

Formula

a(n) = A253563(A003714(n)).
a(n) = A122111(A277006(n)).
Showing 1-7 of 7 results.